- 🇵🇭Philippines mjgruta
Patch #29 doesn't work with Drupal Commerce. It's still asking for variations SKU and Price.
- 🇺🇸United States hyperlinked San Jose, CA
@mjgruta, go into the product types configurations and check the "Allow more than one variation" checkbox. That will move the SKU and Variant Title off of the primary product entity form and allow you to perform a bulk edit.
There's also a workaround you can use in a pinch that works if any field doesn't play well with the patch.
Select the SKU and Price fields and enter a value in for each field. Now uncheck those fields as fields you want to edit. Whatever you just entered will not be applied. They'll remain filled in so you'll be able to submit the form, but the values will be ignored.
- 🇺🇸United States aitala
HI,
Patch #29 allows me to at least post the form but its still giving me an issue with a specific required field.
The field I want to change (Company) and the field which tosses the error (Review Author) are both entity reference fields. (Note: I do no want to change the Review Author field.). I have other required fields which are not throwing errors.
Thanks,
Eric - 🇩🇪Germany kreatIL
@aitala: From your screenshot, one could assume that you ticked "Review Author" before submitting the form. Even if I don't draw that conclusion, I would like to point out that the tick must of course not be set for required fields whose values you don't want to change.
- 🇺🇸United States aitala
HI,
I did not tick the 'Review Author' box before I submitted the form.
I ticked it which revealed the "Review Author (value 1) field required." notice otherwise all you see is the '1 error has been found: Review Author (value 1)' notice with no explanation. The only value I am trying to change is the Company field.
Eric
- 🇲🇾Malaysia ckng
Patch #30 is not working for me too. Have a simple content type with required image field, but trying to bulk update a boolean field, getting error "Image field is required.".
- 🇫🇮Finland ronttizz Helsinki
Patch #30 did not solve the problem, it allows the form to be sent but title and URL are still required. Any updates on this one?
- last update
over 1 year ago Composer error. Unable to continue. - 🇯🇴Jordan n.ghunaim Amman - Jordan
I updated the patch to work for nested form elements, change the required values to false, and remove validateRequired callbacks.
Please review the new patch. - last update
over 1 year ago 8 pass - last update
over 1 year ago Composer error. Unable to continue. - last update
over 1 year ago 8 pass - First commit to issue fork.
- 🇭🇷Croatia portulaca
Patch #45 isn't working for me when Address field has some required fields.
If I make them optional, then the updates for other fields go through, even when the Alt field of an image field is kept as Required.
- Status changed to Needs work
about 1 year ago 10:21am 9 November 2023 - 🇦🇲Armenia arthur.baghdasar
Doesnt work with nested paragraph required fields.
- 🇧🇪Belgium falc0
Patch #45 doesn't work for me. It gives me this error:
TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 436 of modules/contrib/views_bulk_edit/src/Form/BulkEditFormTrait.php).
The problem that triggers the error is that the values are no longer in the $form_state->getValues() but I do find them in the input.
$field_data = $form_state->getValue([$entity_type_id, $bundle]);
So if I replace this line with this, it works but I don't think this is a good solution.
$field_data = $form_state->getValue([$entity_type_id, $bundle]); if (!isset($field_data['_field_selector'])) { $input_data = $form_state->getUserInput(); $field_data = $input_data[$entity_type_id][$bundle]; }
- 🇧🇪Belgium falc0
For me patch #29 works, except for some entity reference fields that are still required. I added some code to the patch to fix my use-case.
- First commit to issue fork.
Provided an update which uses the States API to switch the
#required
fields off/on based on whether the field was ticked or not. And recursively disables the#required
and#access
to fields which the user is uninterested in editing.It should also work with various other field widgets such as Paragraphs or Media Library.
I believe the initial
novalidate
approach isn't advisable since you lose all client-side validations.- Merge request !20Issue #3024419: Add support for optional required fields → (Open) created by codebymikey
- last update
10 months ago 8 pass - last update
10 months ago 1 pass, 4 fail Addressed a flaw in logic where it's possible to accidentally flag a field as "required" as long as it had a
#element_validate
or#validate
property.- last update
10 months ago 8 pass - Status changed to Needs review
10 months ago 12:07pm 29 January 2024 - last update
10 months ago 8 pass - last update
10 months ago 8 pass - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
I was getting two error messages like "An invalid form control with name ... is not focusable". The patch in #57 fixes one of them. The other message remains, causing the VBO action to fail. The error message that remains is about a required field that is part of a paragraph.
- 🇪🇸Spain selvira Seville, Spain 🇪🇸, UTC+2 🇪🇺
Agree with @Liam mortland patch #57 works for me too for the required field focusabled.
Best regards and thanks. - Assigned to selvira
- Issue was unassigned.
- Status changed to RTBC
about 2 months ago 8:02am 17 September 2024 - 🇪🇸Spain selvira Seville, Spain 🇪🇸, UTC+2 🇪🇺
Since it was tested by several people, I've moved it to reviewed and tested.
Best - 🇪🇸Spain selvira Seville, Spain 🇪🇸, UTC+2 🇪🇺
Dear community, I'm going to add a piece of code in order to cover the fields provided by inline entity form.
Best regards
- 🇪🇸Spain selvira Seville, Spain 🇪🇸, UTC+2 🇪🇺
Hi all, I added the code, this can be reviewed.
Many thanks in advance.