This is such a great module that I think does not get the attention is deserves. Without it the workflow for most Drupal Commerce sites is almost unusable. Besides multiple Commerce sites I use it on many other sites too now to allow users/admins to easily select existing entities of all types. A big thank you to the developers.

I do have a feature request for an item that has come up many times in my sites. When creating an Inline Entity Form field I would love to have a setting option to "Prevent adding of new nodes". I know the Add New Node button is not there if the user doesn't have the privilege to add entities of that content type but often we want them to be able to still add the content through the content's on interface but not through the IEF's widget.

Adding an option to disable it would allow greater flexibility in how IEF can be used, cleanup the IEF widget, and prevent mistakes in the user workflow.

CommentFileSizeAuthor
#2 2056139-prevent-add-new-2.patch2.64 KBjoelpittet
#1 inline-entity-form_add_new_option.patch2.93 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Issue summary: View changes
FileSize
2.93 KB

I made a patch, which defines a new checkbox in the field-settings.
So now you can select for each field if you want to allow creating new nodes.

joelpittet’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
2.64 KB

Thanks for the patch @svenssson though it was not relative to the project.

Here's some details: https://drupal.org/patch/
I find it easiest to take the git repo down directly and and do the changes there, but I believe you can do git diff --relative To avoid patches starting from the webroot.

Also for a patching workflow that may be easier to follow: @see http://pittet.ca/drupal/sprint/patch

Anyways, thanks again and here's the re-roll from a relative path. And bumping up to dev because that's what I patched against.

joelpittet’s picture

Title: Add option in setting to "Prevent adding a new node". » Add option in setting to "Prevent adding a new entity".

Minor title change

joachim’s picture

> I know the Add New Node button is not there if the user doesn't have the privilege to add entities of that content type

Off-topic, but I am not finding this to be the case! Users without the permission to add the referenced node type can still create one from inside the IEF: filed #2354169: doesn't respect 'create' permission for referenced entities.

lucyp’s picture

Thanks for these patches. This works great for me, really useful. I hope it gets integrated into next version.

zuernBernhard’s picture

This patch works flawlessly and exactly solves the problem +1 !

Please commit it to the project.

bojanz’s picture

Status: Needs review » Fixed

Committed, thanks.

  • bojanz committed 887eec8 on 7.x-1.x authored by svenssson
    Issue #2056139 by joelpittet, svenssson: Add option in setting to "...

Status: Fixed » Closed (fixed)

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