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.
First, I added field Number type (doesn't matter whether it's float, integer or float) with Required turned ON in any content type.
Then I added Date field with Unlimited value.
Click "Add another item", couldn't add another Date field.
According from console in Google Chrome dev tools, the error was in Ajax call that says:
↵An AJAX HTTP error occurred.↵HTTP Result Code: 200↵Debugging information follows.↵Path: /node/add/page?ajax_form=1↵StatusText: OK↵ResponseText:
But if I turned OFF the Required in the field Number, the problem's gone.
Comments
Comment #2
mpdonadioCan't reproduce this. What browser and OS are you on? What is your admin theme? Is there any error listed in the Recent Log Messages or PHP error log?
Comment #3
ardnet CreditAttribution: ardnet commentedHey mpdonadio, thanks for responding.
So apparently the issue also happen in my VPS with following specs:
* Ubuntu 16.04
* PHP Version 7.0.8
For Drupal specs:
* Drupal 8.2.4
* Admin theme: Seven
And here's what I saw from Apache error logs and Recent Log Messages:
Let me know if there's any other info you need to know.
Thanks
Comment #4
ardnet CreditAttribution: ardnet commentedOK, I just Googled the errors, and it leads me to these issues:
* https://www.drupal.org/node/2648520
* https://www.drupal.org/node/2614250
Thoughts?
Comment #5
mpdonadioThis def looks like it is caused directly by or related to #2027059: Improve the documentation of WidgetBase::errorElement() for mapping violation property paths to form elements. Based on the similar issues, I think we need to postpone on that first.
Comment #6
drugan CreditAttribution: drugan as a volunteer commentedThe possible solution is here:
#2816859: Allow the 'step' to be configured as a NumberWidget setting
It adds default minimum and maximum for integer and decimal fields and much more useful settings. The float field does not have such constraint by default but it silently truncates the field value to 14 digits precision as it said in PHP docs for the float number type.
As for your issue you could add default value for the required field which does not work now but the patch resolves this issue too.
Comment #7
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThis will be fixed by #2901943: Content entity form validation does not respect the #limit_validation_errors property from field widgets.