- Issue created by @mstrelan
- last update
over 1 year ago 29,878 pass, 1 fail - 🇦🇺Australia mstrelan
Trying to debug this but not sure how to solve it. It seems to me the issue is that after clicking "Add another item", or clicking the last Remove button,
\Drupal\Core\Form\FormBuilder::retrieveForm
will retrieve the form with values from the entity, and merge in values inFormState::$input
. The problem is that we are deleting fromFormState::$input
so there is nothing to merge. We need a way to set the value to something that represents "empty" and handle that when the form is rebuilt, or we need to be updating the entity in form state when we remove values from the form. - Status changed to Needs review
over 1 year ago 11:57pm 24 July 2023 - last update
over 1 year ago 29,878 pass, 1 fail - 🇦🇺Australia mstrelan
Looks like
\Drupal\Core\Entity\EntityForm::afterBuild
should be responsible for updating the entity in form state, so it might just be a matter of triggering this from\Drupal\Core\Field\WidgetBase::deleteSubmit
. I'm not sure the correct way to do this but adding$form_state->getFormObject()->afterBuild($form, $form_state);
to the end of\Drupal\Core\Field\WidgetBase::deleteSubmit
seems to work, but I'm not sure the form object is always an EntityForm and also not sure if there would be any other side effects. Attaching a patch as a starting point. - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
This feels major
Discussed with @mstrelan and my initial thoughts are that perhaps
\Drupal\Core\Field\WidgetBase::extractFormValues
should be handling this? Perhaps anelse
for theif ($key_exists)
that does a$items->setValue()
- last update
over 1 year ago 29,879 pass - 🇦🇺Australia mstrelan
Not sure #5 would help when we just want to remove one of the values and not all of them. Attached new patch that should fix the MultipleValueWidgetTest test fail.
The last submitted patch, 4: 3376692-4.patch, failed testing. View results →
- 🇦🇺Australia acbramley
I don't think this is a regression since this is new functionality added in 📌 Allow for deletion of a single value of a multiple value field Fixed , the old way of deleting field items was to clear the field and save the form.
- Status changed to RTBC
over 1 year ago 2:19pm 25 July 2023 - 🇺🇸United States smustgrave
Confirmed the issue in the IS video
Applied patch #6 which solved the issue. - Status changed to Needs review
over 1 year ago 9:49pm 25 July 2023 - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,848 pass, 16 fail The last submitted patch, 13: 3376692-13.patch, failed testing. View results →
- last update
over 1 year ago 29,880 pass, 1 fail - 🇫🇮Finland lauriii Finland
Looks like Media Library had to workaround this already earlier. Trying to make this more generic to make the tests pass.
The last submitted patch, 15: 3376692-15.patch, failed testing. View results →
- last update
over 1 year ago Custom Commands Failed - 🇫🇮Finland lauriii Finland
Here's a new approach that only updates the field item list in the case of deletion. Let's see what the bot thinks about this.
- last update
over 1 year ago 29,882 pass - 🇦🇺Australia mstrelan
Thanks for picking this up. I've tested #18 and can confirm it works with the steps to reproduce. I've also tested it with a much more complex widget (extension of date_recur_modular) and didn't find any issues there either.
- Status changed to RTBC
over 1 year ago 10:45pm 30 July 2023 - 🇺🇸United States smustgrave
Per #19 seems to solve the issue.
Also followed the steps in the videos.
- last update
over 1 year ago 29,908 pass - last update
over 1 year ago 29,946 pass - last update
over 1 year ago 29,946 pass - 🇯🇵Japan eleonel Itoshima 🇯🇵
I'm using this patch on 9.5.x but and the tests patch are failing, so here I uploaded the same patch from #18 without the tests.
- 🇦🇺Australia acbramley
@eleonel please make sure to select "Do not test" when uploading a patch for an older version, otherwise we now have to wait for the test run to fail which will set this issue into Needs work.
- last update
over 1 year ago 29,946 pass 20:45 17:02 Running- last update
over 1 year ago 29,953 pass - last update
over 1 year ago 29,958 pass - last update
over 1 year ago 29,958 pass - last update
over 1 year ago 29,958 pass - last update
over 1 year ago 29,959 pass - last update
over 1 year ago 30,044 pass - last update
over 1 year ago 30,051 pass - last update
over 1 year ago 30,056 pass - last update
over 1 year ago 30,055 pass, 1 fail The last submitted patch, 18: 3376692-18.patch, failed testing. View results →
- last update
over 1 year ago 30,058 pass - last update
over 1 year ago 30,060 pass - last update
over 1 year ago 30,060 pass - last update
over 1 year ago 30,098 pass - Status changed to Needs review
over 1 year ago 4:02am 1 September 2023 - last update
over 1 year ago 30,134 pass - 🇳🇿New Zealand quietone
I'm triaging RTBC issues → . I read the IS and the comments. I didn't find any unanswered questions.
Reading the patch (not a review) I wanted to suggest a change to one of the comment. I have made a new patch.
I also added credit.
- Status changed to Needs work
over 1 year ago 4:06am 1 September 2023 - 🇦🇺Australia mstrelan
+++ b/core/lib/Drupal/Core/Field/WidgetBase.php @@ -77,6 +76,13 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter + // Remove deleted items from the from the field item list.
Typo: from the
- Status changed to RTBC
over 1 year ago 6:21am 1 September 2023 - last update
over 1 year ago 30,134 pass - 🇳🇿New Zealand quietone
Not sure how the status changed. Setting it back to rTBC.
- last update
over 1 year ago 30,135 pass 50:46 49:38 Running- last update
over 1 year ago 30,136 pass - last update
over 1 year ago 30,146 pass - last update
over 1 year ago 30,146 pass - last update
over 1 year ago 30,150 pass - last update
over 1 year ago 30,158 pass - 🇸🇰Slovakia coaston
Is it possible to remove that field with link.
Example :
1. Add reference to User in Article (unlimited)
2. Create node with for example 5+ users
3. Create a view of Article, add this reference field and unclick "Display all values in the same row" so you can see 5 + rows of users
4. Optinally add the same field as delta.And my quesiton is if it is possible also to remove specific user/delta so if we add "edit" link to view it can reach specific delta and only this user will be removed directly with no need to open content and find it manually ????
Very similiar with paragraph here : 3343465 📌 Delete link Needs review which allows you to remove specific paragraph directly with a contextual filter.
- last update
over 1 year ago 30,161 pass - last update
over 1 year ago Checkout Error - last update
over 1 year ago 30,168 pass - last update
over 1 year ago 30,205 pass - last update
over 1 year ago 30,208 pass - last update
about 1 year ago 30,362 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,369 pass, 1 fail The last submitted patch, 28: 3376692-28.patch, failed testing. View results →
- last update
about 1 year ago 30,371 pass - 🇦🇺Australia acbramley
Random failed, retriggered but should be back to RTBC
- last update
about 1 year ago 30,377 pass 20:21 19:33 Running- last update
about 1 year ago 30,384 pass - last update
about 1 year ago 30,393 pass - last update
about 1 year ago 30,397 pass - last update
about 1 year ago 30,410 pass - last update
about 1 year ago 30,415 pass - 🇬🇧United Kingdom alexpott 🇪🇺🌍
-
alexpott →
committed 82b5bc08 on 11.x
Issue #3376692 by lauriii, mstrelan, quietone, acbramley, larowlan,...
-
alexpott →
committed 82b5bc08 on 11.x
- Status changed to Fixed
about 1 year ago 9:49am 19 October 2023 -
alexpott →
committed 06b394a3 on 10.2.x
Issue #3376692 by lauriii, mstrelan, quietone, acbramley, larowlan,...
-
alexpott →
committed 06b394a3 on 10.2.x
Automatically closed - issue fixed for 2 weeks with no activity.