Auto Assign role display an tab with an empty link on login page

gagarine - October 17, 2009 - 09:43
Project:Auto Assign Role
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If you use auto assign role with path but any path replace the normal register page, /user/register tab is still present but without any thing inside. This is a problem for theming...

The html code of the tab on /user page

<ul class="tabs primary clearfix">
   <li><a href="/en/user/register"><span class="tab"></span></a></li>  <<<---- EMPTY LINK
  <li class="active"><a href="/en/user" class="active"><span class="tab">Log in</span></a></li>
   <li><a href="/en/user/password"><span class="tab">Request new password</span></a></li>
</ul>

#1

AllRob - October 23, 2009 - 06:55

confirmed, i have the same 'bug'.

On a clean install i've set up a page as the default register page, the node has a title, as soon as i save the form the register button is empty.

html output looks the same as the above.

#2

mr.baileys - October 29, 2009 - 16:50
Priority:minor» normal

In autoassignrole_menu_alter(), the "user/register" item is overwritten instead of changed, essentially removing the tab title (and other information). Replacing the code near the end of the function with a merge fixes the issue:

if ($path) {
  $items['user/register'] = array_merge(
    array(
      'page arguments' => array($path),
      'page callback' => 'drupal_goto',
      'access callback' => 'user_register_access',
      'type' => MENU_LOCAL_TASK,
    ),
    $items['user/register']
  );
}

an alternative would be:

if ($path) {
  $items['user/register']['page arguments'] = array($path);
  $items['user/register']['page callback'] = 'drupal_goto';
  $items['user/register']['access callback'] = 'user_register_access';
  $items['user/register']['type'] = MENU_LOCAL_TASK;
}

#3

cyberswat - October 29, 2009 - 20:44

ok ... great ... can you roll a patch so it can be tested?

#4

mr.baileys - November 2, 2009 - 12:03
Status:active» needs review

Sure, patch against head attached. I had some issues getting this project checked out in Eclipse (only D5 tags & branches were showing) so I hope I patched against the right version.

I also dropped the "access arguments" element, as this has already been set to "user_register_access" by the user module (or altered to something else by another module, in which case I guess we should not overwrite it).

AttachmentSize
607082-autoassignrole-user-register.patch 811 bytes

#5

mr.baileys - November 2, 2009 - 12:47

Sorry, here's the correct patch.

AttachmentSize
607082-autoassignrole-user-register.patch 811 bytes

#6

mr.baileys - November 2, 2009 - 12:52

Argh. One last try (please ignore the previous two patches).

AttachmentSize
607082-autoassignrole-user-register.patch 805 bytes

#7

maikeru - November 10, 2009 - 00:13

I have the same issue.

Patch in #6 fixed the problem for me in 6.x-1.1 on Drupal 6.9.

#8

cyberswat - November 10, 2009 - 11:49
Status:needs review» reviewed & tested by the community

#9

cyberswat - November 10, 2009 - 11:56
Status:reviewed & tested by the community» fixed

http://drupal.org/cvs?commit=286870

#10

System Message - November 24, 2009 - 12:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.