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.
Node relationships is great, but after adding "Create and reference" and "Edit reference" options, it seems that one more is missing - the ability to delete a relationship.
Comment | File | Size | Author |
---|---|---|---|
#23 | noderelationships.delete-842456-23.patch | 7.39 KB | chrisschaub |
#18 | noderelationships_1.patch | 9.22 KB | hefox |
#12 | del-ref.png | 237.3 KB | doublejosh |
#8 | noderelationships.patch | 9.22 KB | Erik Seifert |
#8 | noderef-sprites.png | 4.3 KB | Erik Seifert |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedSounds reasonable. Sadly, I do not have time. Do you plan to work on this feature? If not, I think we can leave this f.r. open for a while to see if someone else is interested in working on it.
Comment #2
phayes CreditAttribution: phayes commentedAlso, once we have a delete button, the ability to hide the text-field input element might be useful. In combo with http://drupal.org/project/reference_preview, users will be able to search, add, edit, and preview node-references with no typing. It's not ideal for everyone, but it's the interface I will need.
Comment #3
markus_petrux CreditAttribution: markus_petrux commentedI'm going to mark this issue as won't fix because it looks to me such a feature will confuse users [1], and the alternative workflow is simple enough and clear [2].
[1] Confuse because a button to remove a reference could mean just that, or it could also mean to remove the referred node. Not easy to explain the difference to all potential users of the module.
[2] Alternatively, you can enable the "View reference in new window", and the user can use it to see the Delete node button in that page. Once the node is deleted, if you use the Referential Integrity for CCK module, it can set the Node Reference field to NULL in the node delete operation. And a refresh of the original page should show updated information.
It seems to me the alternative approach [2] is so easy and clear that it does not worth to spend the time coding something that could be confusing.
The issue could be re-opened if/when someone can come up with a patch for review. The feature would have to be optional, and it should be easy and clear for the user to understand what the button would do.
Comment #4
jaxpax CreditAttribution: jaxpax commentedI'm with kiprasm regarding the possibility to remove a relationship item, but I can see the possible confusion that markus_petrux is referring to in #3 [1]. I would like to see the possibility to remove an item from the list of related nodes, while in node add/edit, with the help of a button, next to the other buttons. This would be a real enhancement from a usability point of view. Now one would have to go through the "search multiple item" -button to accomplish the same thing. The feature is actually there already but it's hidden and it's not so clear how to reach it. It's just a matter of having the same possibility from another view as well.
I think that it's just a matter of how one would formulate the feature, so that users and end users would know the actual purpose of the feature. One would have to formulate that the button only removes this one instans of the node from the list of related nodes, and is not deleting anything.
If a user/end user would miss out on the real action of the feature, than the worst that could happen is just that an instans of a node is removed, nothing gets deleted anyway.
Comment #5
stefan81 CreditAttribution: stefan81 commentedA few ideas towards usability:
the button could be "clear" or "unlink".
Instead of an "x" icon a "-" or "unchain" icon would probably be better interpreted. (see attachment)
as a relation can be undone simply by deleting the text in the input field,
I think the job could be done with a small javascript that clears the input field on click.
Comment #6
jaxpax CreditAttribution: jaxpax commented@stefan81
Great ideas, simple and clear for everybody to understand. Nice touch with the icons.
-Patrik
Comment #7
Erik Seifert CreditAttribution: Erik Seifert commentedPatch for a button to remove a relationship ( it simple remove field content not more! )
You can add this functionality on settings page for a field ( nodereference extras ).
You must copy attached image to: noderelationships\images
Comment #8
Erik Seifert CreditAttribution: Erik Seifert commentedSorry forgot to remove a dpm call.
@See #7
Comment #9
vurt CreditAttribution: vurt commentedTested against the stable version: works as expected!
Thank you Erik!
Comment #10
isaac77 CreditAttribution: isaac77 commented+1
This is a great addition, improves usability a lot. Applied patch to 6.x-1.6, and it is working as expected.
Comment #11
doublejosh CreditAttribution: doublejosh commentedWould be great to have the ability to enable "Add new item" without having to also allow "Create and Reference."
This with patch it could enable "Delete | Edit" and "Add another" below.
... like a node reference spreadsheet :)
Comment #12
doublejosh CreditAttribution: doublejosh commentedHere's an image to illustrate the goal I'm referring to.
Comment #13
Erik Seifert CreditAttribution: Erik Seifert commentedBetter take #5, because you do not delete a reference. You unlink a reference.
Comment #14
doublejosh CreditAttribution: doublejosh commentedSeeing the nuances of this issue now.
There is no "Delete" button while in the reference node edit modal as discussed in #3.
Seems like without this patch the only way to remove a reference or the referenced node is to delete the text in the autocomplete field.
Am I missing something?
In my use case relationships are a one-to-many so unlinking will be a delete action. (Looking at Referential Integrity for CCK.)
Though I suppose this thread might be headed toward a different use case.
Comment #15
hefox CreditAttribution: hefox commentedWhy was this at 'active'?
Sounds like debating still so set it to needs work.
Edit: Patch works so far for me.
Comment #16
hefox CreditAttribution: hefox commentedSince it looks like the patch in #7 is ready to review, setting it to that (or am I missing something in the back and force above) and trying to clearify the title.
Comment #17
gregglesThis doesn't apply to the dev from 2010, so I'm guessing it doesn't apply to head.
That said, I would really like to be able to remove a relationship. I think it's more confusing that it's missing...
Comment #18
hefox CreditAttribution: hefox commentedNot updated to -dev yet, but small update to change delete to remove; if not using delete icon, shouldn't say delete, nay? Unlink sounds confusing, so put remove for now. shrug.
Comment #19
markus_petrux CreditAttribution: markus_petrux commentedHow does this button look when used with CCK3, that already provides a button to remove items in a multiple value field?
Comment #20
art is code CreditAttribution: art is code commentedHi,
Although everyone seems to apply the above mentioned patch successfully, I get the following parse error :
Line 277 has the following variable :
var $deleteButton = $(Drupal.theme('nodeRelationshipsReferenceButton', 'delete', Drupal.t('Delete reference')));
I have to say it's the first time I see jQuery code included in a php file this way, and can't manage to debug this.
Thanks for possible clues !
Comment #21
Erik Seifert CreditAttribution: Erik Seifert commentedThere is something going wrong how do you patch this module. This code should applied to node_form.js . Not for the module. Have a look in the patch file:
Comment #22
hefox CreditAttribution: hefox commentedThe "Issue title" field is for the issue title, it's not a comment title.
Comment #23
chrisschaub CreditAttribution: chrisschaub commentedI'm uploading patch #18 re-made against the latest 6.x-.1.x-dev branch. Seems to work for me. You also need the noderef-sprites.png image attached in number #8 put in your images directory.
Comment #24
chak_boss CreditAttribution: chak_boss commentedHow can i do like this in drupal 7. Am very eagerly waiting to do this in drupal 7.
Can any one help me in this.
Thanks in advance.