Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Updated: Comment #0
Problem/Motivation
Cannot create field with unlimited values, get a WSOD or an exception message.
Steps to reproduce:
- Install D8
- Create a Date field in the Article content type, select Unlimited for Allowed number of values and leave everything else in the next form as is.
- BAM!
Also tried image field, got WSOD.
Proposed resolution
Remaining tasks
- Write a test.
- Write a fix.
- Test with every other field type (if needed).
User interface changes
None.
API changes
None.
Exception error
[Sun Dec 29 14:28:14.202270 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP Fatal error: Drupal\\Core\\Field\\ConfigFieldItemList::defaultValuesFormValidate(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Drupal\\datetime\\Plugin\\Field\\FieldWidget\\DateTimeDefaultWidget" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/penyaskito/projects/d8/core/lib/Drupal/Core/Field/ConfigFieldItemList.php on line 100, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202308 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP Stack trace:, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202338 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 1. {main}() /home/penyaskito/projects/d8/index.php:0, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202345 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 2. drupal_handle_request() /home/penyaskito/projects/d8/index.php:15, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202351 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 3. Drupal\\Core\\DrupalKernel->handle() /home/penyaskito/projects/d8/core/includes/bootstrap.inc:1886, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202357 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 4. Drupal\\Core\\HttpKernel->handle() /home/penyaskito/projects/d8/core/lib/Drupal/Core/DrupalKernel.php:282, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202363 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 5. Symfony\\Component\\HttpKernel\\HttpKernel->handle() /home/penyaskito/projects/d8/core/lib/Drupal/Core/HttpKernel.php:52, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202369 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 6. Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() /home/penyaskito/projects/d8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:61, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202375 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 7. call_user_func_array() /home/penyaskito/projects/d8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:117, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202381 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 8. Drupal\\Core\\Controller\\HtmlFormController->content() /home/penyaskito/projects/d8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:117, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202387 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 9. Drupal\\Core\\Form\\FormBuilder->buildForm() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Controller/HtmlFormController.php:69, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202393 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 10. Drupal\\Core\\Form\\FormBuilder->processForm() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:267, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202398 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 11. Drupal\\Core\\Form\\FormBuilder->validateForm() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:601, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202407 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 12. Drupal\\Core\\Form\\FormBuilder->doValidateForm() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:863, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202413 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 13. Drupal\\Core\\Form\\FormBuilder->executeHandlers() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:1114, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202422 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 14. call_user_func_array() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:1204, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202428 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 15. Drupal\\field_ui\\Form\\FieldInstanceEditForm->validateForm() /home/penyaskito/projects/d8/core/lib/Drupal/Core/Form/FormBuilder.php:1204, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
[Sun Dec 29 14:28:14.202433 2013] [:error] [pid 1882] [client 127.0.0.1:50403] PHP 16. Drupal\\Core\\Field\\ConfigFieldItemList->defaultValuesFormValidate() /home/penyaskito/projects/d8/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php:169, referer: http://d8.local/admin/structure/types/manage/article/fields/node.article.field_wiki_date?destinations[0]=admin/structure/types/manage/article/fields
Comment | File | Size | Author |
---|---|---|---|
#18 | multiple_image_field-test-2164151_0.patch | 1.93 KB | yched |
#16 | interdiff.txt | 676 bytes | yched |
#16 | multiple_image_field-test-2164151.patch | 1.93 KB | yched |
#14 | multiple_image_field-test-2164151.patch | 1.96 KB | yched |
#7 | failing-test.patch | 1.96 KB | penyaskito |
Comments
Comment #1
yched CreditAttribution: yched commentedthat sounds like something #1989468: Weird messing with 'default_value_function' in date widgets ? would fix ?
Comment #2
yched CreditAttribution: yched commentedOops, sorry - not if you say this happens on image fields too.
Comment #3
swentel CreditAttribution: swentel commentedI can't even reproduce the error, with date or images.
Comment #4
swentel CreditAttribution: swentel commentedAlso, this is probably for the field system :) But again, can't reproduce at all. Are you sure you're on a fresh install ?
Comment #5
swentel CreditAttribution: swentel commentedSo it looks like this is some kind of PHP thing. Works fine here locally on 5.3.14 and 5.4.4.
simplytest is on 5.3.10 and fails completely ...
Comment #6
penyaskitoOriginally reproduced with 5.5.3.
I will try to write the test for this.
Comment #7
penyaskitoA patch reproducing the problem locally.
Comment #8
penyaskitoLet's see what happens on the testbot.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedi can reproduce the WSOD locally following the steps in OP. this is at least major.
Comment #11
effulgentsia CreditAttribution: effulgentsia commentedThis is a regression from D7, so therefore, critical. Also, this would pretty seriously impact people's ability to beta test, so tagging as "beta blocker".
Comment #12
yched CreditAttribution: yched commentedSo, what muddies the waters here is that date fields are currently funky/broken wrt their handling of default values. This is cleaned in #1989468: Weird messing with 'default_value_function' in date widgets ?, which is currently sitting in the RTBC queue.
Locally testing on a 5.3.10 setup:
- on HEAD, creating a date field with "unlimited valued" triggers the bug
- with patch in that issue over there, things work fine.
So, as far as date fields are concerned, this is as dupe of #1989468: Weird messing with 'default_value_function' in date widgets ?.
What we should focus on here are the non-date aspects of the bug here, if any.
But although the OP claims that the same bug happens with image fields, I'm not able to reproduce it on a local 5.3.10 :
- Install D8
- Create a
Date*Image* field in the Article content type, select Unlimited for Allowed number of values and leave everything else in the next form as is.-
BAM!Works :-)Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedi can't reproduce this with image fields either.
Comment #14
yched CreditAttribution: yched commentedReuploading the test from #7 with an image field instead of a date field.
Comment #16
yched CreditAttribution: yched commentedEr, wrong patch...
Comment #18
yched CreditAttribution: yched commentedSigh... hand editing patch files...
Comment #20
yched CreditAttribution: yched commented18: multiple_image_field-test-2164151_0.patch queued for re-testing.
Comment #22
yched CreditAttribution: yched commentedWe have that many random fails in HEAD currently ?
18: multiple_image_field-test-2164151_0.patch queued for re-testing.
Comment #23
yched CreditAttribution: yched commentedSo, yeah, image fields seem fine - @penyaskito : do you have more precise steps to reproduce a problem on fields other than date ?
Til then, closing as a dupe of #1989468: Weird messing with 'default_value_function' in date widgets ? (which just got in)
Comment #24
xjmComment #25
penyaskitoCannot reproduce anymore. Tried with different field types including date and image. Thanks everyone!