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
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
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
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).
#5
Sorry, here's the correct patch.
#6
Argh. One last try (please ignore the previous two patches).
#7
I have the same issue.
Patch in #6 fixed the problem for me in 6.x-1.1 on Drupal 6.9.
#8
#9
http://drupal.org/cvs?commit=286870
#10
Automatically closed -- issue fixed for 2 weeks with no activity.