Drupal 7: If a new field/instance isn't working...

13 May 2011
Posted by jcfiala

Something useful sounding from #drupal-colorado:

<cyberswat> drush php-eval '_field_info_collate_fields(TRUE); _field_info_collate_fields()' ... arrrrrggggghhhh /me curses loudly
<cyberswat> should never have to run that
<cyberswat> c4rl: if you ever have an instance where your installing new fields and instances and every piece of code tells you that everything worked from the update hook but you still don't see the instance then run the above
<cyberswat> that took between 4:00am and now to figure out

<cyberswat> for some reason field_cache_clear(); in field_create_instance() didn't do the above as it should have
<cyberswat> field_read_instances() reads from the db not cache
<cyberswat> so when your drush_print_r ing away you'll see wrong information telling you everything is golden

This sounds like an important thing to remember.

Tags: