Download & Extend

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

Project:Auto Assign Role
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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>

Comments

#1

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

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

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

#4

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).

AttachmentSizeStatusTest resultOperations
607082-autoassignrole-user-register.patch811 bytesIgnored: Check issue status.NoneNone

#5

Sorry, here's the correct patch.

AttachmentSizeStatusTest resultOperations
607082-autoassignrole-user-register.patch811 bytesIgnored: Check issue status.NoneNone

#6

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

AttachmentSizeStatusTest resultOperations
607082-autoassignrole-user-register.patch805 bytesIgnored: Check issue status.NoneNone

#7

I have the same issue.

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

#8

Status:needs review» reviewed & tested by the community

#9

Status:reviewed & tested by the community» fixed

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

#10

Status:fixed» closed (fixed)

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