Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The ability to automatically create an entity in case it doesn't already exist, reference it on the field and backreference it (if possible),
Something similar as this:
http://drupal.org/project/noderefcreate
http://drupal.org/project/autocreate
There is also a module for creating the referenced node in a popup, but I don't think this would be in the scope of this module.
However, I believe the requested functionality would.
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThanks for reporting this, but this type of feature is not in the scope of the module. Any other module can provide a new widget on top of the entityreference field, this module is only providing the base functionality.
Comment #2
Fidelix CreditAttribution: Fidelix commentedMakes sense, Damien.
Thank you for the attention.
If someone takes interest in toying with this:
The noderefcreate module is small (164 lines), and this function seems to be doing the whole work:
IMO, this seems doable and not so painful.
Comment #3
Yuri CreditAttribution: Yuri commentedAlthough out of scope, a great idea! I make much use of the noderefcreate module.
Just to elaborate a bit more on possibilities: until now creating and populating one field was only possible.
Would be nice to have an Entity Reference Create module that allows to create and populate multiple (if not all) fields of the referenced entity.
That would take away a lot of work that is now done when referencing an entity, navigating to the referenced entity, filling in additional fields, refreshing/opening/closing windows etc. Even more, I think that the nested-entity-fields-reference-create-field is the future. :-)
EDIT: I just realize that something similar is already present in the Field Collection module. Wow I love Drupal.
Comment #4
Fidelix CreditAttribution: Fidelix commentedYuri, can you point to where you got that information? Thanks!
Comment #5
Yuri CreditAttribution: Yuri commentedThe concept of creating other entities while editing an entity, has taken form in the Field Collection module http://drupal.org/project/field_collection. However, that module still needs to mature a bit. But it includes views integration and development goes fast.
Comment #6
ransom CreditAttribution: ransom commentedsubscribing
Comment #7
ransom CreditAttribution: ransom commentedI've had some problems addressing the proper settings perhaps someone with more entity knowledge can help? It also needs an administrative front end to select the entity type to auto create & if you want to be fancy the ability to choose which type during setup with maybe some ajax on a non identified content type during auto-complete.
This is virtually a strait port of node ref create that will create an undefined and editable node. Please note also code is not up to drupal, and there's no guarantee of anything than a starting point for those who know what they are doing.
Comment #8
bryancasler CreditAttribution: bryancasler commented#1411972: Field Collections and TheVerge Possibly of interest to folks here.
Comment #9
michaek CreditAttribution: michaek commentedI've put @ransom's code, with some changes, in a sandbox here: http://drupal.org/sandbox/michaek/1451014
I would describe it as minimally functional, but I wouldn't feel at all good about using it on a production site.
Comment #10
fox_01 CreditAttribution: fox_01 commentedHere's a module that display a form of the sub related entity and if it doesn't exists then the empty form shows up. Maybe thats what you are looking for.
relation edit widget
Comment #11
nickbits CreditAttribution: nickbits commentedI have been searching for this very functionality. Just incase others are also looking for it, I believe you should be looking at the Entity Connect module.
Comment #12
valderama CreditAttribution: valderama commentedAnother option very similar to Entity Connect is http://drupal.org/project/references_dialog