to reproduce:
1. fresh install of D7 HEAD standard profile
2. go to #overlay=admin/structure/types
3. follow link to edit article fields --> #overlay=admin/structure/types/manage/article/fields
4. add a new field, name doesn't matter, type doesn't seem to matter (i tested file, image, text, boolean)
error messages:
* Notice: Undefined index: _add_new_field in _field_ui_field_overview_form_validate_add_new() (line 518 of /var/www/drupal/core/7/content/modules/field_ui/field_ui.admin.inc).
* Warning: array_shift() expects parameter 1 to be array, null given in _form_set_value() (line 2033 of /var/www/drupal/core/7/content/includes/form.inc).
we can't release D7 with basic functionality throwing errors, so setting as critical.
Comments
Comment #1
Anonymous (not verified) commentedi'm working on a test that will fail (because of the notices).
Comment #2
Anonymous (not verified) commentedseems like we have a test for creating fields, FieldUITestCase::createField(), that should fail. now trying to figure out why that doesn't, but real life does.
Comment #3
berdirUnable to reproduce, not in an old install (did get an exception thrown without stack trace error there though... i really thought we got rid of them ?!), not in a fresh install, not in a fresh install with all core modules and a dozen contrib modules.
Not critical unless someone else can reproduce imho...
Comment #4
Anonymous (not verified) commented@berdir thanks for trying to reproduce. putting back to critical until we get another "can't reproduce".
i just double checked that i've got a fresh cvs checkout, fresh install, etc, and i can still reproduce.
Comment #5
Anonymous (not verified) commentedok, just managed to avoid poking my own eyes out to find this.
the field_ui tests for this prepend 'field_' to the test field names, which means that test avoid the real-life borked code in
_field_ui_field_overview_form_validate_add_new():the problem with this code is that '_add_new_field' doesn't live at the top level of $form, but in $form['table'].
so the naive fix is to change
to
patch attached, but this needs some field people to look and see if there's a deeper issue, and more work to fix the tests.
Comment #6
Anonymous (not verified) commentedComment #7
chx commentedI can confirm the issue exists and the patch works and i doubt there is anything deeper going on isnt this the result of a recent patch , extend field ui from contrib?
Comment #8
Stevel commentedLooks like this fixes the issue indeed. getting notices would depend on the PHP configuratino I think.
Comment #9
pflame commentedI am able to reproduce this bug with latest Drupal HEAD codebase. And the patch worked fine.
Comment #10
Anonymous (not verified) commentedwoah, we need to fix the tests so they exercise this code.
Comment #11
pflame commentedIn the test case form element field_name value assigned as 'field_'. strtolower($this->randomName(8));
But when we submit the manage fields form the field_name value does not contain the 'field_' prefix.
The bellow code is trying to add the prefix as 'field_'
but the code raising notice and warning because the form_set_value statement should be
I fixed the test case and attached the patch.
Comment #12
marcingy commentedComment #13
Anonymous (not verified) commentedworks for me, simple patch, RTBC.
Comment #14
dhthwy commented+1 RTBC.
Comment #15
dries commentedCommitted to CVS HEAD. Thanks.
Comment #16
zserno commentedI'm sorry to say, but I can't see this patch in my recent checkout neither here: http://drupal.org/project/cvs/3060, so setting it back to RTBC.
Comment #17
webchickOk, committed it this time. :) Thanks!
Comment #18
yched commentedAw - sorry about the bug, I did rely on test passes.
Comment #19
Anonymous (not verified) commentedyched: what, your code is not always completely bug free?!? ;-)
Comment #20
yched commentedre justinrandell : Of course it is. Must've been my cat walking on the keyboard.