Closed (fixed)
Project:
Inline Entity Form
Version:
3.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2024 at 19:20 UTC
Updated:
19 Jun 2026 at 06:45 UTC
Jump to comment: Most recent
Comments
Comment #3
saidatomComment #4
dimilias commentedFor reference, this is reproducible only if the user does not have the access to delete the entity removed. In
web/modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php:914there is a check alreadyand the
deletecheckbox is not added if the user does not have 'delete' access. This, checking either for the access or if the array key exists is a valid case.I don't know if tests are needed as this is a warning and a simple missing check that does not affect the end result. The user does not have access, the entity is also not marked for deletion.
Comment #5
geek-merlinThx a lot, this makes a lot of sense.
But code is overly complex. Please use the more idiomatic
!empty($form_values['delete'])Comment #7
bharath-kondeti commentedComment #8
arthur.baghdasar commentedComment #10
anybody@geek-merlin I simplified the code as suggested in #5. So I guess this can be merged.
Comment #12
bluegeek9 commentedI added a variable for the if() statement to make it clearer what the intent is. I also added a kernel test.
Comment #13
anybodyThank you, LGTM!
Comment #15
dwwComment #18
dwwThanks for working on this! Especially thanks @bluegeek9 for the Kernel test. I confirmed locally it fails without the fix applied. Can also see it at https://git.drupalcode.org/project/inline_entity_form/-/jobs/10122967 in the last pipeline.
I pushed a commit to try to improve the readability of the
ifstatement. I ran the full pipeline on all versions of core, and everything is green: https://git.drupalcode.org/project/inline_entity_form/-/pipelines/837497Merged to 3.x.
Thanks again!
-Derek
Comment #20
anybodyThank YOU very much @dww for merging all these changes now! Very important, thanks!