Problem/Motivation
After upgrading the several notice appear when editing any node in the system.
Notice: Undefined index: required in field_default_form() (line 61 of /../drupal/modules/field/field.form.inc).
Workaround for D7 sites
As this is now committed to core for upgrading users suffering this on their Drupal 7 install can follow the manual fix:
- Visit each content type
- Check the required for each taxonomy term fields
- Save it.
- Optional revisit and uncheck the required for a selection of taxonomy term fields.
Original report by steinmb
Testing updating a small 6.19 installation and keep getting this warning when edition any node in the system.
* Notice: Undefined index: required in field_default_form() (line 61 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: required in field_default_form() (line 61 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: required in field_default_form() (line 61 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: required in field_default_form() (line 61 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: description in field_multiple_value_form() (line 155 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: required in field_multiple_value_form() (line 173 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
* Notice: Undefined index: required in field_multiple_value_form() (line 202 of /Users/steinmb/htdocs/sites/smbjorklund.com/drupal/modules/field/field.form.inc).
The installer did not throw any error/warnings during the upgrade. As far as I have been able to find in the code is http://api.drupal.org/api/function/field_ui_default_value_widget/7 the only one using function field_default_form(), but after an upgrade is Field UI (field_ui.module) not enabled.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | core-taxonomy-undefined-index-952970-10.patch | 1.49 KB | clemens.tolboom |
| #8 | core-taxonomy-undefined-index-952970-8.patch | 1.46 KB | clemens.tolboom |
Comments
Comment #1
jpoesen commentedGot hit with that problem too.
Described in detail and solved here: http://drupal.org/node/931512
Comment #2
yched commentedDupe of the issue pointed by jpoesen
Comment #3
clemens.tolboomI reopen this as it is not a duplicate of #931512: Node body 'description' and 'required' are missed on nodes upgraded from D6 to D7
I get error even after applying the patch [#931512#56]
It differences in function names field_default_form() versus field_multiple_value_form()
Comment #4
clemens.tolboomMy content type blog has a image field.
After migrating the image field with cck content_migrate the error is still there.
Visiting admin/structure/types then save the blog type does not help.
Visiting admin/structure/types/manage/blog/fields/field_images then saving shows 'allowed extensions' field empty but that still doesn't remove it.
I need to debug this tomorrow.
Comment #5
Kolibri commentedHello, my content type "member" has an image field.
I migrated the site, and after this I'm now unable to delete or upload images over the edit-form of the content type.
I get the same Notice as clemens.tolboom.
"Notice: Undefined index: required in field_default_form() (line 75 of /www/htdocs/w00d7c70/intern/modules/field/field.form.inc)."
Has anyone an idea what the problem is?
Comment #6
clemens.tolboom@Kolibri: You changed the version and category.
- Please don't change a Bug (which this is about) into a support request.
- The bug is confirmed in drupal 7.x head code so it most probably also in 7.4
As I said I'm on it.
Comment #7
clemens.tolboomI found the problem which lies with taxonomy free form field I use. It is not required for my blog.
The required instance key is missing for taxonomy field during the upgrade.
Workaround: Checking the required, then saving, then unchecking the required fixed it.
I'll check the fix from #931512: Node body 'description' and 'required' are missed on nodes upgraded from D6 to D7 as it is a similar bug and make a new patch out of it
Comment #8
clemens.tolboomPatch contains similar test as #931512: Node body 'description' and 'required' are missed on nodes upgraded from D6 to D7.
The taxonomy terms do have the required field in drupal-6.filled.database.php defined. And are mixed yes/no required.
My test does only tests for the existence of the required key.
Can we do better?
Comment #9
yched commentedFix looks fine, but
$vocabulary->required ? TRUE : FALSE,could be shortened to just$vocabulary->required?Comment #10
clemens.tolboomApplied yched improvement.
Added minimal documentation to test lines.
Comment #11
yched commentedOops, minor code style issue :
Missing trailing point.
Otherwise, looking good.
Powered by Dreditor.
Comment #12
webchickFixed that, then committed and pushed to 7.x. Thanks!
Comment #14
snsace commentedI just upgraded 6 to 7.12 and get this same error as in #3.
For me the error is happening only when editing nodes of content type (Poll).
Comment #15
giorgio79 commentedChanging to correct tag
Comment #16
snsace commentedComment #17
snsace commentedSry, duplicate. Moved my inquiry here:
http://drupal.org/node/931512#comment-5707898
Comment #18
clemens.tolboomClosed again.
(ssace meant #931512: Node body 'description' and 'required' are missed on nodes upgraded from D6 to D7)
Comment #18.0
clemens.tolboomAdded template and added a workaround for D7 users upgraded before the patch.