When anonymous users click the claim link they are taken to the registration page. After registration, they should be redirected to the node claim page, but instead are sent to the homepage.

I found the problem to be with the following code from the nodeownership_node_view function contained in the nodeownership.module file.

// If the user is anonymous.
  if (!$user->uid) {
    $link = l($text, 'user/register', array('query' => array('redirect' => 'node/' . $node->nid . '/claim')));
  }

I was able to fix the problem by replacing 'redirect' with 'destination' as follows:

// If the user is anonymous.
  if (!$user->uid) {
    $link = l($text, 'user/register', array('query' => array('destination' => 'node/' . $node->nid . '/claim')));
  }

Comments

sja1’s picture

Attaching patch.

sja1’s picture

Fixing malformed patch

ashishdalvi’s picture

Assigned: Unassigned » ashishdalvi
rasikap’s picture

Status: Needs review » Reviewed & tested by the community

  • Ashish.Dalvi committed 62324dd on 7.x-1.x authored by sja1
    Issue #2399773 by sja1, Ashish.Dalvi, rasikap: Redirect after...
ashishdalvi’s picture

Status: Reviewed & tested by the community » Closed (fixed)