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.
Currently, if I unlink a contact from /redhen/contact/%redhen_contact/view/user
, the entry in the redhen_contact_user
table remains, but this status is sent to NULL. This prevents me from re-linking that user to the same contact in the future.
A user just accidentally unlinked a contact and wanted to re-link it to the contact. In order to fix it, I had to manually update the redhen_contact_user
table.
Possible suggestions:
- If an entry already exists in
redhen_contact_user
, show the user a confirm dialog to make sure that the do, indeed want to re-link the contact. - Create a new site-wide setting , "Allow un-linked users to be re-linked to contacts"
I'm happy to work on a patch for either solution, but I was unsure what they best way to proceed would be.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1788496-redhen-improve_unlink_delete_ux-5.patch | 3.98 KB | SocialNicheGuru |
#4 | redhen-improve_unlink_delete_ux-1788496.patch | 3.96 KB | andyg5000 |
Comments
Comment #1
levelos CreditAttribution: levelos commentedSome more messaging to users would be great. There's actually two actions already available: Deleting the connection does allow it to be re-added. Unlinking, however, is designed to prevent recreating the linkage. This could be much better communicated and any patches would be welcome.
Comment #2
Weijian CreditAttribution: Weijian commentedAs temporary solution, I just remove the unlinked validation and update the contact user status to 1. It works for me. Hope this help others.
1. Remove the validation code of below in function redhen_contact_contact_user_form_validate
2. Change the function setUser to update the contact user status for the unlinked -> relink case
Add code after
if ($row->contact_id == $contact->contact_id && $row->status == NULL) {
to replace "return FALSE" with:
Comment #3
levelos CreditAttribution: levelos commentedComment #4
andyg5000We had this issue with users accidentally getting unlinked. Here's a patch that adds a confirm form as well as some descriptions and new button labels to hopefully improve the user experience.
The patch does not address re-linking unlinked contacts. I'm still reading up on the reason to unlink vs delete and will submit another patch if that feature is necessary.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedre-roll for latest release 7.x-1.3
https://www.drupal.org/project/redhen/releases/7.x-1.13
Comment #6
Dishvola CreditAttribution: Dishvola commentedI've used my code snippet when I wanted to re-link drupal user to the contact.
You can use "/devel/php" page for code executing if devel module are installed and enabled.
It worked for me :)