When displaying the confirmation form in a popup, and if there is a link in the approve / disapprove / cancel message, clicking on this link will close the popup instead of opening the link. So any link acts as if it is the "Cancel" button.

This is caused by the following block of code in user_relationships_ui.js:

    // Making sure the cancel link on each form in the popup closes the popup.
    $('#user_relationships_popup_form a').click(function() {
      Drupal.user_relationships_ui.hidePopup();
      return false;
    });

As you can see, any "a" tag will be treated like the cancel link. Patch incoming.

Comments

mdupont’s picture

Status: Active » Needs review
StatusFileSize
new955 bytes

This patch is rather simple: confirm_form() wraps action buttons inside a "div" with the class "container-inline", so by restricting the target to links in this container, only the cancel link will be affected by the js code.

Status: Needs review » Needs work

The last submitted patch, 1284960-confirm_form_make_links_work-1.patch, failed testing.

mdupont’s picture

Status: Needs work » Needs review
StatusFileSize
new743 bytes

This one should have the right paths.

mrf’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Active

Committed to 6.x-1.x dev, thanks for the patch and catching this one.

Just did a quick glance at the file and this appears to still be an issue for 7.x so there will need to be a fix there as well.

mrf’s picture

Status: Active » Patch (to be ported)
berdir’s picture

Status: Patch (to be ported) » Fixed

Aaand commited as well ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bao truong’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
StatusFileSize
new939 bytes

I tried the patch in comment #8 but it didn't work, probably because it was created for a version that was different form mine, I am submitted this patch for the following version:

name = UR-UI
description = "User Relationships UI. This enables basic UI functionality for User Relationships"
package = "User Relationships"
dependencies[] = user_relationships_api
core = 6.x

; Information added by drupal.org packaging script on 2012-01-03
version = "6.x-1.x-dev"
core = "6.x"
project = "user_relationships"
datestamp = "1325552071"

mrf’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Patch is already applied to both dev branches, no need to re-apply.

Please let us know if you're still seeing the issue in the dev branch.