Category: Drupal

Drupal taxonomy_get_term_by_name() and Encoded Characters

Drupal’s API method taxonomy_get_term_by_name() chokes and fails to return the taxonomy term when the term name has encoded characters. The trouble is that term names are usually encoded by the time you pull them from the $variables array in a hook. This means that a taxonomy term with an ampersand would not get looked up […]

Clearing Out Drupal Features Checkboxes

Drupal has a Features module which allows for certain configuration settings (Views/Context/Content Types) to be exported to code. This way you can separate out configuration from content, and avoid having to sync databases up/down environments. Except that sometimes (in my experience) you hit a wall with a created feature. I’m not sure where that limit […]

When Drupal Says Your New Field Name Already Has a Table

Sometimes I run into phantom fields that I had created for a content type that I later destroyed: There was a problem creating field Artist Name: Table field_data_field_[YOUR FIELD NAME] already exists. Instead of sighing and choosing another name, you can delete the table in the database, and the corresponding field_revision_field_[YOUR FIELD NAME].

Drupal’s Ctools Object Cache

Not sure why (there are so many things I don’t know about Drupal, frankly) but occasionally when creating/cloning a View, I’ll get the following error message when saving: PDOException : SQLSTATE[23000]: Integrity constraint violation: I’ve taken to using a workaround gleaned from this thread on drupal.org. I examine the database using Sequel Pro, find the […]