Hello,
We have an use case where we don't want editors to accidentally modify referenced entities by accident form the entity form because it could affect to other entities referencing to the same one.
We would like to only allow them to reference an existing one or create a new one. Once a referenced entity is saved and they want to modify them, they should be forced to do that in the referenced entity own edit form.
Our idea is to add an extra option to the Complex widget to allow administrators to hide/show the "Edit" button in the widget.
Best,
Pablo
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 3143422-18.patch | 3.66 KB | rajab natshah |
| #16 | optional_edit-3143422-16.patch | 3.64 KB | rbrissaud |
Issue fork inline_entity_form-3143422
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
plopescAdding patch.
In case you are interested in this feature, I could add tests to have more solid patch ready to be merged.
Cheers
Comment #3
vbouchetI think this feature request definitely makes sense. I tested it and it does the job. Having some basic test just to confirm the button is displayed or not is probably appreciable given the numerous tests which already exist in the module.
Comment #4
vbouchetTest needed
Comment #5
rajab natshahThank you for the patch!
Tested it and it's working well
Comment #6
rajab natshahComment #7
geek-merlin@RajabNatshah: If you set RTBC, provide a reasoning why you do so. Especially why you ignore the reasoning from #4.
So in the end: #4 i right, this needs test coverage.
Comment #8
rajab natshahThanks, Merlin for having time to follow up on this issue <3
Agrees with you. I rushed into changing the status as:
We have been using the patch in Varbase with number of projects for long time
Related issues:
#3155922: Change default entityqueue form display for the [Media Hero Slider] entity queue

#3156138: Add patch for [Inline Entity Form] module to allow to hide the Edit button in Complex widget
I hoped that it could be better to have it in the latest release or the next one.
#3209310: Update Inline Entity Form module from 1.0-rc8 to 1.0-rc9
The test case could be a complex one too.
like the entityqueue case, or a product, paragraph, or other ways.
Do you have any proposed automated testing for this complex change?
or a custom coded entity with a custom inline entity form too.
My only hope to have this feature in the next release.
Comment #9
geek-merlinOK let's see how we can get this in. But i'm not sure i understand the question.
I agree with #3:
> Having some basic test just to confirm the button is displayed or not is probably appreciable given the numerous tests which already exist in the module.
So this should be super simple.
Comment #10
plopescNew version of the patch adding basic tests.
Comment #12
edysmpFor multiple bundles, could we have a setting per each one?
Let's say I want users to edit Articles but not Basic Pages direcltly in the widget.
Comment #13
rajab natshahTested the 3143422-10.patch under PHP 8 after the new 1.0-rc10
It's working well.
+ Basic automated testing.
Comment #14
geek-merlinThanks for pushing this forward! See review.
Also, if that is fixed, please follow the tradition to add a "test-only-shoud-fail" patch or MR, to prove the test tests what it claims to test.
For the to-commit solution, i'd prefer adding to the MR.
Comment #15
rajab natshahAgrees with Merlin :)
Thanks for having extra time to follow up on this issue.
Maybe I'm rushing to have this feature in the module. As it is been tested for almost 1 year in many projects.
Following and moving to the MR workflow for sure.
Comment #16
rbrissaud commentedHello,
I fix the patch with new version (in InlineEntityFormComplex.php)
Comment #17
rajab natshahThanks, Rémi
The patch #16 is working with Inline Entity Form 8.x-1.0-rc15
Comment #18
rajab natshahAttaching at patch file to patch
2.0.0-beta3and the2.0.xbranchComment #21
rajab natshahIt appears that the issue fork is outdated.
I am unable to create a new branch for
2.0.x.If this issue is approved as a new feature, it will likely be committed to the 2.0.x branch.
Comment #24
bharath-kondeti commentedComment #26
rajab natshahThanks, Andrii
Noticed that this feature request was merged and released.
Just to make sure.
Do this need a hook update?
Or the default in code is helping in both cases, old config and new config schema.
2.0.0-beta2to2.0.0-beta61.0.0-rc15to2.0.0-beta6Comment #27
podarokI don't think we need a hook update for this
I'd rely on default value
Any concerns from your end?
Comment #28
rajab natshahThank you, Andrii for following up
Agrees with you, Tested - working very well
No need for hook update.
You can close this issue.
Comment #29
podarokThank you for the double check
I appreciate
Comment #32
tkiehne commentedIt appears that this fix was applied to the 2.x branch which was then abandoned - issue needs to be reopened.
Edit: It appears that #2913571 has taken the ball for 3.x