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.
On my field settings, I have Search, add, and edit checked, and I have created a view for the search dialog. Both the Search and Add buttons show up on my node edit page, but there is not an Edit button. Is that not yet functional, or am I missing something?
Comment | File | Size | Author |
---|---|---|---|
#21 | edit-links-display-1257808-21.patch | 2.52 KB | GDrupal |
#18 | references_dialog_edit_link-1257808-18.patch | 738 bytes | sanchiz |
#17 | references_dialog_edit_link-1257808-17.patch | 717 bytes | geophysicist |
#10 | references_dialog_edit_link-1257808-10.patch | 4.76 KB | imclean |
#7 | references_dialog_edit_link-1257808-7.patch | 2.75 KB | imclean |
Comments
Comment #1
andylhansen CreditAttribution: andylhansen commentedAfter messing around with it some more, I found that you first have to save the node form in order for the "Edit" link to appear. So I'd like to change this to a feature request that on a create node page, that once you have selected a node for a node reference field, that the edit link will appear on the form.
Comment #2
fabsor CreditAttribution: fabsor commentedI completely agree. I will get to work on this as soon as possible.
Comment #3
webankit CreditAttribution: webankit commentedThis feature will be gr8,
Beside this, on clicking edit a reference, Node Page open.
It will be gr8 if the path of editing that node open directly.
Comment #4
grndlvl CreditAttribution: grndlvl commentedComment #5
ejustice CreditAttribution: ejustice commentedI'd find this useful.
Also I think it would be helpful if the create link was removed if an entity/node/user has been entered into the field. This would help prevent confusion on the users' part when using this in an unlimited setting (the fact that you need to click add another item then create in the new row. Also it would be helpful in preventing overwriting values that have already been entered in the field.
I don't know if you want this as a separate feature request as I see them being linked, but others may not.
Comment #6
imclean CreditAttribution: imclean commentedI've addressed both the original request and the one by ejustice in #5 in another issue:
#1774466: References Dialog UI improvements - contextual create and edit links, hide input option
Comment #7
imclean CreditAttribution: imclean commentedThis uses ajax to replace the create link with an Edit link if the user has update permissions.
It doesn't yet check the widget settings to see if the Edit operation is enabled. This is an essential function but I've run out of time right now. Uploading anyway in case anyone wants to have a go.
Comment #8
imclean CreditAttribution: imclean commentedCurrent issues with #7:
- Doesn't check Widget Settings for Edit operation
- Resets when "Add another item" is clicked
- Permission check not correct for all entity types. Only really tested with nodes but should work with entities.
It replaces the Create link so effectively deals with #5.
Comment #9
imclean CreditAttribution: imclean commentedI'm working on a more robust solution.
Comment #10
imclean CreditAttribution: imclean commentedTry this one.
Comment #11
imclean CreditAttribution: imclean commentedJust a note on permission checking: the above uses entity_access() from the Entity API module. This, from my novice understanding of entities, should pass the request on to the appropriate access callback for that entity.
Comment #12
imclean CreditAttribution: imclean commented@ejustice #5, see: #1788596: Don't show Create link for fields which have a value
Comment #13
phoenix CreditAttribution: phoenix commentedThanks for the patch. It adds the edit link now, but edit or create aren't opened in a dialog anymore. I guess you introduced a javascript bug.
In my console I see this: "Uncaught TypeError: Cannot read property '2' of null "
Is this error coming from this part?
Drupal.ReferencesDialog.ajaxEdit(key, matches[2], matches[3]);
It's the only new part where you want to get property 2. Now looking why matches is null.
I tried some console.log().
-
console.log($('#' + key).val());
Returns the values from the autocomplete entity reference field (eg. "title (34)").
-
console.log(matches);
Returns "null".
I guess there's something wrong with the regex in this part:
Comment #14
imclean CreditAttribution: imclean commentedHmm...it works on node/edit for me but not node/add.
Won't be able to look at this for a little while but it does need fixing.
Comment #15
rogical CreditAttribution: rogical commentedUsing js is somehow not very stable, I've added an ajax callback to automatically refresh the widget, add link would be removed edit link would display then. I'll add this feature to references dialog after more testing.
http://drupal.org/sandbox/rogical/1880826 References Thumbnail
Comment #16
DamienMcKennaPardon me for jumping into this issue, but shouldn't all of the logic managing the links be handled via JS? Collaborating on #1774466: References Dialog UI improvements - contextual create and edit links, hide input option would be the best solution as there are several related problems that should be fixed together.
Comment #17
geophysicist CreditAttribution: geophysicist commentedHere is my js fix. I just change create link to edit link when popup closes.
Comment #18
sanchiz CreditAttribution: sanchiz commentedUpdated patch #17 to include base_path.
Comment #20
VasyOK CreditAttribution: VasyOK commentedThanks, #17 work's for me!
Comment #21
GDrupal CreditAttribution: GDrupal commentedI have been working on a UI tweaks for this. It adds a little extra feature to update the edit link on each reference change.
Comment #22
igorik CreditAttribution: igorik as a volunteer commented#17 works for me, #21 doesn't work for me.
However, I would prefer to add this option:
While I found in autocomplete suitable node, so I don't need to use dialog in lightbox, after chosing the option in autocomplete, the link "Edit" could be added next to "+ Create"
So it could be possible to edit chosen option, or create new one.
Comment #23
jay.lee.bio CreditAttribution: jay.lee.bio commentedJust like @igorik, #17 also works for me but #21 doesn't.
I also want to take #22 further, because there's an inconsistent user interface issue that's potentially confusing:
1) I think "Edit" from #17 should say "Edit Content Type" to match "Create Content Type".
2) I also think "Edit" that displays after node is saved should say "Edit Content Type".
3) I also think "Edit" ("Edit Content Type") from #17 should not replace "Create Content Type" but instead be added to it (to the left, just like how it's displayed after node is saved).
4) Per #22, "Edit" ("Edit Content Type") should be added to the left of "Create Content Type" when the Autocomplete option is used instead of "Create Content Type".
5) If I decide to reference another node on 4), update "Edit" ("Edit Content Type"). I believe this is what #21 is trying to do, but I created a separate issue for it because I believe it's a different although related bug that should be taken care of on its own page.