Frameworks

You have specified an invalid media URL for Custom URL

Now here’s one for the “Read the manual” and “Bad validation messages cause big headaches”.  On setting up a feed import for a Flickr  based feed I was unable to import the images correctly (despite being sure I had set up my CCK fields and mappings correctly).  Each time I ran the import (using the excellent [...]

Drupal search index not updating (Says “The index will be rebuilt”)

In early days of experimenting wiht Drupal, mostly pretty good news I have to say, I’m enjoying it’s flexibility and the large number of modules that speed things up!
One problem I just came across was that under admin>settings>search the “Re-index site” button was not working when clicked, it just kept repeating “The index will be rebuilt” [...]

Drupal installation fails at Database configuration

Trying to install Drupal?  Failing at the Database configuration stage?
Read the manual!
Or, when you fail to do that properly refer to posts like this:
http://drupal.org/node/484534#comment-1675612
As it says:
default.settings.php isn’t supposed to be “changed” it is supposed to be copied and renamed settings.php
this in sites/default you should have 2 files default.settings.php and settings.php
This is exactly the opposite of [...]

HABTM relationships not saving properly?

Digging around today because I had a problem with CakePHP holding on to old values in a multi select that was used to maintain a HABTM relationship.  The issue was that I could add items fine, but it never deleted old items in the select list.
I’d obviously overlooked one of the key points that is [...]

Expected response code 200, got 404

After months of successful operation my google spreadsheets implementation (using cakePHP and Zend Framework just stopped working.  After reading this post on google groups it became obvious that the urls used for the API have changed slightly, the arrays returned in various responses have also been reordered.
If you’re getting this error all of a sudden, [...]

Poedit ‘ctp’ is unknown; will try C.

xgettext: warning: file ‘.ctp’ extension ‘ctp’ is unknown; will try C.
Need to force the PHP parser to be treated as text regardless of the extension.
Open Poedit’s preferences and navigating to the parsers section there. In the PHP parser under ?Parser command?  set the command to be:
xgettext –language=PHP –force-po -o %o %C %K %F
REF:
G-ROC web applications

$displayField – title override in CakePHP

Had a problem this morning, I’m using  non standard title field in my table (I’m experimenting with different ways of making a db multilingual).  CakePHPexpects to see a field called “title” to populate drop downs etc when using $belongsTo – it’s one of Cake’s automagic field conventions.  To override this however, you can in the [...]

Doing a DISTINCT select with CakePHP

To select DISTINCT records from a database, simply use the field selector attribute of a normal findAll query.
I.e. to select a grouping of years from a date column (I needed to do this for a summary page I was working on) the syntax is simply:
$this->Model->findAll(null, array(‘DISTINCT year(dateField) as yearGroup’));
Note that DISTINCT must be written in [...]

Google group for CakePHP

The most useful resource for CakePHP related queries, to be honest Cakes documentation can be a little sparse at times and this has been really helpeful for me when I’m struggling with something

CakePHP | Google Groups:
The other place you should look for good code examples and tutorials is The cake bakery it can be a [...]

Simple RSS feeds in CakePHP

RSS in cakephp 1.2 couldn’t be simpler, there are many options however the simplest way to do it is using the inbuilt RSS request handler.  This simply tells Cake to route requests with a specific extension (in this case .rss) to a different view, in which you can return native RSS using the inbuilt RSS [...]