profile2
Drupal 7 notes - dealing with "ghost fields"
Came across a problem someone else on Drupal dubbed “ghost field” in one of the issue queues. My issue with ghost fields came about while setting up Profile2 to use in my profile (strangely), but the problem happens in other modules as well.
The problem
- create a profile type (or modify the main one)
- add a field
- delete the field (I don’t recall seeing any difference between saving data in the field or not)
- try to add a new field with the same name, get an error saying the field name is already in use, but it doesn’t appear in the “Add existing field” list
The solution
- manually edit the database. I use phpmyadmin. Whatever works
- find the tables
field_config
andfield_config_instance
, browse them and delete all incidences of the “ghost fields” - fields can now be recreated
After deleting the ghost field instances the php fatal error and associated debug messages I’d been having trouble tracking the source of (Entity was getting blamed) disappeared, quite conveniently.