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.
Great module,. however I cannot for the life of me get it to work.
Everything works great up to the point of saving a new user, and then the entity reference field shows Client(94) instead of Test Test(3859), not sure where the Client or random UID is coming from but saving the node then fails as the refernced user is invalid (doesnt exist.)
Has anyone else seen this behaviour?
Comments
Comment #1
adevms CreditAttribution: adevms commentedI have the same situation.
It's because there's another entity attached to the user entity, in my case it's a Profile2 entity. After saving a new user the references_dialog_entity_insert() gets called twice, once for the user entity and once for the Profile2 entity.
Because of this the destination parameter gets rewritten with the new profile entity's id and the entity reference field get's filled with the Profile type and new profile id.
Checking if the destination parameter is set, solves the problem. I'm attaching a patch.
Comment #2
haydeniv CreditAttribution: haydeniv commentedWhen there is a patch an issue should have the status Needs review so the maintainer knows that there is code to review.
Comment #3
sebkamil CreditAttribution: sebkamil commented@adevms your patch doesn't seem to change anything. Could you explain how you fixed this? Thanks
I have a similar issue where I am adding videos as Assets. When they are transcoded though, the Reference Dialog references the file rather than the Asset.
edit - Nevermind. I applied the path wrong. It doesn't fix my problem though. Will post an update once I get it fixed.
Comment #4
sebkamil CreditAttribution: sebkamil commentedThe attached is working for me.
Comment #6
SpaghettiBolognese CreditAttribution: SpaghettiBolognese at Emble commentedBoth patches did not fix the full for me so I updated the patch from #1. Works for both adding and updating entities.
Comment #7
scalas89 CreditAttribution: scalas89 commentedJust cleaned the patch to let it work with drush make.
Comment #8
foagth CreditAttribution: foagth commentedPatch #7 also works for entity references to a type having a workflow field.
If not patched, the entity reference field takes the workflow's id e.g. Workflow State (444)
Comment #9
majusz CreditAttribution: majusz commentedHad the same problem, not with a user, but with a node on an Entity reference field.
Patch #7 works for me, too. Thanks very much!