Updated: Comment #0

Problem/Motivation

Cannot create field with unlimited values, get a WSOD or an exception message.

Steps to reproduce:

  1. Install D8
  2. 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.
  3. 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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Active » Closed (duplicate)
yched’s picture

Status: Closed (duplicate) » Active

Oops, sorry - not if you say this happens on image fields too.

swentel’s picture

I can't even reproduce the error, with date or images.

swentel’s picture

Component: configuration entity system » field system

Also, this is probably for the field system :) But again, can't reproduce at all. Are you sure you're on a fresh install ?

swentel’s picture

So 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 ...

penyaskito’s picture

Originally reproduced with 5.5.3.
I will try to write the test for this.

penyaskito’s picture

FileSize
1.96 KB

A patch reproducing the problem locally.

penyaskito’s picture

Status: Active » Needs review

Let's see what happens on the testbot.

Anonymous’s picture

Priority: Normal » Major

i can reproduce the WSOD locally following the steps in OP. this is at least major.

Status: Needs review » Needs work

The last submitted patch, 7: failing-test.patch, failed testing.

effulgentsia’s picture

Title: Cannot create field with unlimited values » Regression: Cannot create field with unlimited values
Priority: Major » Critical
Issue tags: +beta blocker

This 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".

yched’s picture

So, 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 :-)

Anonymous’s picture

i can't reproduce this with image fields either.

yched’s picture

Status: Needs work » Needs review
FileSize
1.96 KB

Reuploading the test from #7 with an image field instead of a date field.

Status: Needs review » Needs work

The last submitted patch, 14: multiple_image_field-test-2164151.patch, failed testing.

yched’s picture

Status: Needs work » Needs review
FileSize
1.93 KB
676 bytes

Er, wrong patch...

The last submitted patch, 16: multiple_image_field-test-2164151.patch, failed testing.

yched’s picture

Sigh... hand editing patch files...

Status: Needs review » Needs work

The last submitted patch, 18: multiple_image_field-test-2164151_0.patch, failed testing.

yched’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 18: multiple_image_field-test-2164151_0.patch, failed testing.

yched’s picture

Status: Needs work » Needs review

We have that many random fails in HEAD currently ?

18: multiple_image_field-test-2164151_0.patch queued for re-testing.

yched’s picture

Status: Needs review » Closed (duplicate)

So, 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)

xjm’s picture

Issue tags: -beta blocker
penyaskito’s picture

Cannot reproduce anymore. Tried with different field types including date and image. Thanks everyone!