Currently when a user is logged out they may see a link like

<a href="/user">
Log in
<br/>
to vote
</a>

It would be nice if it went to

<a href="/user?destination=path/to/current/page">
Log in
<br/>
to vote
</a>

Comments

Anonymous’s picture

Try this:

--- plus1.module	2009-03-18 06:04:42.000000000 +0100
+++ plus1.module	2010-02-02 19:10:03.000000000 +0100
@@ -296,7 +296,7 @@
   if (!$logged_in || user_access('vote on content')) {
     $output .= '<div class="'. $message_class . '">';
     if (!$logged_in && !user_access('vote on content')) {
-      $output .= '<small>'. l(t('Log in<br />to vote'), 'user', array('html' => TRUE)) .'</small>';
+      $output .= '<small>'. l(t('Log in<br />to vote'), 'user', array('query' => 'destination=node/' . $node->nid, 'html' => TRUE)) .'</small>';
     }
     else if ($voted) { // User already voted.
       $output .= check_plain(variable_get('plus1_you_voted', t('You voted')));
greggles’s picture

That only works if you are currently on a full node view. what if a user is looking at a list of teasers?

NancyDru’s picture

Assigned: Unassigned » NancyDru
Status: Active » Patch (to be ported)

This will be fixed when I commit.

NancyDru’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-2.x-dev.

Status: Fixed » Closed (fixed)

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

j0rd’s picture

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

I don't think this code is in the 7.x version.

Ideally, when a user clicks on Vote, and they need to login/register first.

After they login via what ever means, their vote will be counted and they'll be redirected back to the page where they initiated the vote.

I think that's most likely the best UX.