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

Command icon 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

plopesc created an issue. See original summary.

plopesc’s picture

Status: Active » Needs review
StatusFileSize
new2.16 KB

Adding patch.

In case you are interested in this feature, I could add tests to have more solid patch ready to be merged.

Cheers

vbouchet’s picture

I 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.

vbouchet’s picture

Status: Needs review » Needs work

Test needed

rajab natshah’s picture

Thank you for the patch!
Tested it and it's working well

rajab natshah’s picture

Status: Needs work » Reviewed & tested by the community
geek-merlin’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

@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.

rajab natshah’s picture

Thanks, 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
Better look to Add existing item

#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.

geek-merlin’s picture

OK 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.

plopesc’s picture

Status: Needs work » Needs review
StatusFileSize
new3.6 KB
new1.5 KB

New version of the patch adding basic tests.

edysmp’s picture

For 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.

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

Tested the 3143422-10.patch under PHP 8 after the new 1.0-rc10
It's working well.
+ Basic automated testing.

geek-merlin’s picture

Status: Reviewed & tested by the community » Needs work

Thanks 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.

rajab natshah’s picture

Agrees 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.

Noted;
Not only to have a functional/unit test pass with green.
It should pass the acceptance criteria of the maintainer or product owner.

rbrissaud’s picture

StatusFileSize
new3.64 KB

Hello,
I fix the patch with new version (in InlineEntityFormComplex.php)

rajab natshah’s picture

Thanks, Rémi
The patch #16 is working with Inline Entity Form 8.x-1.0-rc15

rajab natshah’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
StatusFileSize
new3.66 KB

Attaching at patch file to patch 2.0.0-beta3 and the 2.0.x branch

shivam_tiwari made their first commit to this issue’s fork.

rajab natshah’s picture

It 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.

bharath-kondeti made their first commit to this issue’s fork.

bharath-kondeti’s picture

Status: Needs work » Needs review

podarok made their first commit to this issue’s fork.

rajab natshah’s picture

Thanks, 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.

  • Testing to update from 2.0.0-beta2 to 2.0.0-beta6
  • Testing to upgrade from 1.0.0-rc15 to 2.0.0-beta6
podarok’s picture

Status: Needs review » Postponed (maintainer needs more info)

I don't think we need a hook update for this
I'd rely on default value
Any concerns from your end?

rajab natshah’s picture

Thank you, Andrii for following up
Agrees with you, Tested - working very well
No need for hook update.
You can close this issue.

podarok’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thank you for the double check
I appreciate

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tkiehne’s picture

It 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