when a user is logged out the form action to be able to return the user to the page they're on when they log in is not working properly

it's generating random (non-existing!) event links for me
example: from being logged out on the home page

<form action="?q=user&amp;destination=event%2F2008%2F07%2F17%2Fday%2Fall%2Fall"...
leading to
http://www.example.com/event/2008/07/17/day/all/all

I don't even have the event module on this site, I have calendar but it doesn't produce URL's like that.

looking at the module code it is this line:

      $form['#action'] = '?q=user&'. drupal_get_destination();

It's leading to a lot of page not found errors in my logs

Comments

Suzy’s picture

Status: Active » Needs work

I've tweaked this module so it works for me see this post for more details but I am not confident of my module writing/patching capabilities, especially when it comes to forms - so I'll post what I see and hope someone else will find it usefu. or can roll a patch.

original in userloginbar.module:

      $form['#action'] = '?q=user&'. drupal_get_destination();
      $form['#method'] = 'post';
      $form['form_id'] = array(
        '#type' => 'hidden',
        '#default_value' => 'user_login',
      );

I think parts of the form alter code need updated, or even removed as there is no need to alter to match exisiting functionality? At the very least only the ID might need fixing to avoid the duplicate ID that is being produced by the form and the wrapper div, though I would just change the ID on your wrapper div in the module code and then remove all the bits above, but that will require a CSS change too

for reference, from the user.module, showing why I think the drupal_get_destination function was 'wonky' for me,
and the #id value I don't think is being targeted properly in the userloginbar.module leading to the duplicate ID?

  $form = array(
    '#action' => url($_GET['q'], array('query' => drupal_get_destination())),
    '#id' => 'user-login-form',
    '#validate' => user_login_default_validators(),
    '#submit' => array('user_login_submit'),
  );

Suzy