Category Archives: CakePHP

SQL dump file for CakeDC comments plugin for CakePHP

If they (CakeDC people) don’t have complaint of any kind or whatsoever i would like to post the SQL dump code for comments table used in CakeDC comments plugin. Especially, those having problems with generating database table or query through cake console could find this sql dump useful. But, before using this dump, please try to compare it with the latest schema file that could be found in config/schema.php file of the plug-in, it is possible that they might have altered the structure of the table in the meantime (It is Nov 02, 2010 today), so please use it at your own risk. Continue reading

Auto linking text string having image tags using Text Helper in CakePHP

Recently I found that auto linking urls and emails of a string having image tags within was not possible using text helper in CakePHP. It would try to autoLink url of image src and thus it is broken. I am not sure what the issue is in including a fix or solution which could avoid image tags while auto-linking. Then, perhaps you would have to consider other tags like object src and video urls etc. In fact it would be too tedious to handle all kind of html tags and so and so.. Continue reading

Field type tinyint(1) would not save values other than 0 and 1 in CakePHP

Just a quick note. I had a “is_active” field in my users table which i had been using to store boolean 0 and 1 values. Later, i mean today, i decided to save a new value -1 to this field but when i did try, it would’t save -1 and would always save it as 1. After looking at a few blog posts around the web i found that in CakePHP every time you try to save a value other that 0 or 1 into a tinyint(1) field it would save it as 1 (as according to Nate, Continue reading

Security component black hole, form submit dies on a blank page with no error

The problem started when i used Auth component in my current CakePHP project. Everything seemed working fine until i created an html form, submitted it and tried to retrieve this form’s data in controller action. I tried to print $this->data in controller action but it showed nothing and ended on a blank white page (which is called “blackHole” in Security component’s language). Continue reading

Fix to jQuery plugin does not work on ajax loaded content

I had been loading table records through ajax pagination using jquery. Some of the urls/links (View Details, Edit and Delete) in loaded content had been using thickbox to handle respective requests. Although, if i did’t use the ajax to load records these links would work fine and thickbox would open. But once i introduced ajax they suddenly stopped working. Continue reading