Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using a Date List field in a Webform. I refresh the form and receive the following error.
Warning: array_diff(): Argument #2 is not an array in Drupal\Core\Datetime\Element\Datelist::checkEmptyInputs() (line 357 of /vagrant/htdocs/core/lib/Drupal/Core/Datetime/Element/Datelist.php)
Comment | File | Size | Author |
---|---|---|---|
#2 | date-list-value-callback-check-null-2946538-2.patch | 627 bytes | aeotrin |
Comments
Comment #2
aeotrinThe following check that $input exists seems to do the trick. Any other suggestions?
Comment #3
mpdonadioWhat is $input in this case? Is it NULL like the title suggests? Probably need a small test to show this?
Comment #4
aeotrinIn the case of refreshing a webform, the value of $input being passed in is NULL. Which causes the subsequent calls using $input to fail. I will try to write the tests for this when I have some time, unless anyone else comes across the same issue.
Comment #5
bdlangton CreditAttribution: bdlangton commentedI looked into adding some tests for this, but I was unable to reproduce the issue. Whenever I refreshed the form, $input was set to FALSE.
Comment #11
larowlanThanks, on the basis of #5 this sounds like it is no longer occurring
It may be that webform has since changed.
@aeotrin are you able to provide steps to reproduce, starting from 'Install Drupal core'?
Thanks.
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedIt is has been over a year and no steps to reproduce have been provided. Considering that this was not reproducible 4 years ago I think it is safe to close this now. Closing as outdated.
If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!