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.
It would be really useful if a link was added, along with the others, to remove the item from the reference field.
Comment | File | Size | Author |
---|---|---|---|
#29 | reference_dialog-remove-item-link-1945914-29.patch | 1.08 KB | lklimek |
#25 | 1945914-25-remove-item-link.patch | 1.15 KB | Cogax |
#14 | drupal-refdialog.png | 9.19 KB | mengi |
#7 | references_dialog-n1945914-7.patch | 1006 bytes | DamienMcKenna |
Comments
Comment #1
DamienMcKennaSome wip JS code to chew on:
The question is how should this work:
I think that the links should be more intelligent anyway, they should recognize when the field has changed and show/hide the edit and/or create links as appropriate.
Comment #2
DamienMcKennaReading through the code more, I think the links themselves should be inserted via JS so that they can be more readily manipulated rather than only being inserted via PHP.
Comment #3
DamienMcKennaUpdated JS that hides the row entirely.
Comment #4
DamienMcKennaI'm not the best at JS, so feel free to poke fun at it :)
Comment #5
DamienMcKennaRelated issue for EntityReference: #1946010: Improve UX around clearing an item
Comment #6
DamienMcKennaRelated: #1946086: Restructure so the links are built via JS
Comment #7
DamienMcKennaA patch to provide a 'remove' link if there is an existing 'edit' link.
Comment #8
sk2013 CreditAttribution: sk2013 commentedThank you all for the good work.
We have tried the patch with the alpha4 version, but did not have any luck. Would it be possible to guide us or any pointer will help.
We are using this module with references module for adding and editing node. Edit is working fine. We want to remove the node, but we did not get the "remove" link after applying the patch.
Thanks in advance.
Comment #9
DamienMcKenna@sk2013: You need to apply it to the latest -dev version.
Comment #10
sk2013 CreditAttribution: sk2013 commentedThanks a lot Damien! I will update once I complete the work as suggested.
Thanks again
Comment #11
sk2013 CreditAttribution: sk2013 commentedHello Damien,
I have tried with the latest -dev version and updated with this patch. But there is no "remove"link appeared. Tested in a fresh Drupal installation and there is no luck.
Is there any way we can find what's causing the "remove" link not appearing?
Thanks a Lot!
Comment #12
cecrs CreditAttribution: cecrs commentedWorks beautifully, thanks Damien!
Comment #13
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedWorks nicely for us.
Comment #14
mengi CreditAttribution: mengi commentedPatch in #7 works for me with one very minor exception with the inline_entity_form module on the same page. Any interaction of the ief module will make mutiple (4-6) remove buttons appear. I attached a image to better explain. This doesn't seem to effect the functionality as the reference will still be removed if I click on any of the buttons.
Comment #15
liquidcms CreditAttribution: liquidcms commenteda few things wrong with this patch:
- this doesnt create the correct UL structure; it adds the new LI inside the last one as opposed to inside the UL
- doesn't incl an icon
- doesn't work for newly added items (like picking one from search)
this patch is closer:
- correct UL structure
- add icon
- fix other LI classes
but still doesn't do the .live() part of this to add remove when an item is newly added
Comment #16
paramnida CreditAttribution: paramnida commentedThe patch in #15 didn't work for me. I'm using version 7.x-1.0-beta1+4-dev.
Comment #17
MarcoPBazz CreditAttribution: MarcoPBazz at Bazzmann Agency commentedPatch in #15 doesn't work form me.
changing the html selectors and adding few controls (because function itself create duplicate buttons with multiple value field or multiple entityreference fields) made it work
Comment #18
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedupdating issue status
Comment #22
MarcoPBazz CreditAttribution: MarcoPBazz at Bazzmann Agency commentedAny update? Can I help?
Comment #23
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedReplace "Rimuovi" with a translatable string.
Comment #24
MarcoPBazz CreditAttribution: MarcoPBazz at Bazzmann Agency commentedHi SocialNicheGuru,
here's the patch!
Comment #25
Cogax CreditAttribution: Cogax commentedAll previous patches selects only entity reference fields. This patch also supports an translateable link label.
Comment #27
lklimek CreditAttribution: lklimek at Software Inn commentedAdded some triggers to the code to ensure compatibility with entityreference_live_preview (see also #2682665: Automatically load entity preview when using entityreference_live_preview)
Comment #28
fox_01 CreditAttribution: fox_01 commented#27 works for me with entityreference_live_preview but if you select an entity and then remove it the remove button will get hidden and does not apear again
Comment #29
lklimek CreditAttribution: lklimek at Software Inn commentedFixed issue from comment 28 by removing lines:
(however, I don't understand why it was placed there by original author of the patch).
Comment #30
fox_01 CreditAttribution: fox_01 commented#29 works. thanks
Comment #31
kmajzlik CreditAttribution: kmajzlik commentedJust trying to schedule CI test.