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

icanbedeleted’s picture

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.

mr.baileys’s picture

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;
}
cyberswat’s picture

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

mr.baileys’s picture

Status: Active » Needs review
StatusFileSize
new811 bytes

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

mr.baileys’s picture

StatusFileSize
new811 bytes

Sorry, here's the correct patch.

mr.baileys’s picture

StatusFileSize
new805 bytes

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

maikeru’s picture

I have the same issue.

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

cyberswat’s picture

Status: Needs review » Reviewed & tested by the community
cyberswat’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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