1

All of a sudden a site on my development server has been producing this php notice:

Notice: Use of undefined constant FIELD_BEHAVIOR_DEFAULT - assumed 'FIELD_BEHAVIOR_DEFAULT' in _field_info_prepare_instance() (line 297 of /var/www/mysite/modules/field/field.info.inc).
Notice: Use of undefined constant FIELD_BEHAVIOR_DEFAULT - assumed 'FIELD_BEHAVIOR_DEFAULT' in field_behaviors_widget() (line 458 of /var/www/mysite/modules/field/field.info.inc).

Is there anyway to narrow down which module could be causing this error? I've tried disabling a couple but have had no luck so far. I don't want to just disable the display of the warning as I feel I need to find the root of the issue :)

Has anyone else seen this error before? I suspected it might've been the GMap and Location modules for D7, but I've now removed them and I'm still getting this issue.

Thanks for your help!

2

FIELD_BEHAVIOR_DEFAULT is defined in the core field.module file, which will always be loaded into the page build if you have the core field module enabled.

If you're getting an error that it's not defined then either the field module isn't being loaded for whatever context you're receiving the error in, or the field.module file has been corrupted/changed.

Try getting the field.module file from a fresh copy of Drupal and replacing it on your site, that might fix the problem. If not, grep your sites/all/modules folder for the string FIELD_BEHAVIOR_DEFAULT. That should help you narrow down the modules that use it, and which ones you should try to disable.

  • 1
    Depending on your environment you may want to check file permissions and ownership as well. But as Clive stated, installing a fresh copy of field.module would be the first thing I would try as well. – Citricguy Jul 26 '12 at 11:30
  • thank you so much! seems that replacing the files with the originals fixed the problem. Still wracking my brain to find out how they could've become corrupted in the first place, I wasn't hacking the core promise! :) – Alex Kirsten Jul 26 '12 at 13:23
  • @AlexK Just blame someone else I find it makes life much easier! For future reference the Hacked! module will check the integrity of core/contrib files and let you know if there have been any changes – Clive Jul 26 '12 at 13:43
0

To more generally answer the title question, how to narrow down problems, I often find webchick's debugging patch really useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.