The problem this patch is addressing was throwing only notices on PHP 7.4 but is throwing errors on PHP 8+, so the patch is valid I think. Steps to reproduce this using the focal_point module:
On Vanilla Drupal 9.5+
- Enable the modules media, media_library and focal_point
- Add an image style with a focal_point image effect
- Configure the media_library form display of image media to use the Image (Focal point) field widget
- Add a media field to the article content type
- Configure the form display of the article content type to use the media_library widget
- Add an article and add a media to the article by uploading a new image
- After uploading the image, do not enter an alt text and click save
There will be an ajax error originating from the location in code the patch here changes.
- Status changed to Needs work
over 2 years ago 1:18pm 2 March 2023 - πΊπΈUnited States smustgrave
If valid it will need a test case to show the issue.
Though not sure thatβs a fix that would get committed. This may be covering a symptom of a bigger issue. Like why is that value not set when it gets to this point?
But either way tests will 100% be needed
- ππΊHungary szato
Maybe related to Focal point image widget causes validation errors not to be shown π Focal point image widget causes validation errors not to be shown Needs work ?
- π¨π¦Canada hargurpreet Kitchener
Updated patch #3 to fix a notice in core/lib/Drupal/Core/Form/FormState.php on line 1174
- πΊπΈUnited States pixlkat
I also was seeing this error, but with different form elements. We have a taxonomy entity reference field with unlimited cardinality, and we are using inline entity form to add an existing term. We are also using Inline Form Errors to display error messages inline.
When submitting the IEF form with an error condition, it appears that the `actions` element was the form element causing the error. This issue was not present when using IEF to add a new entity.
Applying the patch in #14 fixed the error in our case.