Hi,

I'm using the module Pathauto (7.x-1.2) to create alias. Here is my problem, when i create node and mobile_switch is activated, the alias creating doesn't work. It seems like all the tokens using 'menu' (my pattern is '[node:menu-link:menu:name]/[node:menu-link:parents]/[node:menu-link]') return an empty string.

Debugging, i find that the call to drupal_alter at the line 65 of the mobile_switch.module is the reason of that but i have really no idea why, so i need your help.

    drupal_alter('mobile_switch_boot', $conf, $get);

Thanks for your time.

Comments

mattew’s picture

I use Mobile Theme instead of Mobile Switch : http://drupal.org/project/mobile_theme and i don't have the pathauto issue.

quiptime’s picture

Status: Active » Postponed (maintainer needs more info)

@guillaume.d,

when i create node and mobile_switch is activated, the alias creating doesn't work

If the Mobile Switch Basic setting Administration usage configured to Yes or No?

quiptime’s picture

It seems like all the tokens using 'menu' (my pattern is '[node:menu-link:menu:name]/[node:menu-link:parents]/[node:menu-link]') return an empty string

I'm not sure if I understand correctly this pattern.

To reproduce your problem I've done the following:

  • Configured Pattern for all Article paths to [node:menu-link:menu:name]/[node:menu-link:parents]/[node:menu-link]
  • The Mobile Switch module deactivated! <<---
  • A new article node created.

The result:

No path alias created for the new article node.

Ndesign’s picture

Im currently running in to the same issue with Mobile Switch and Pathauto. When I disable Mobile Switch i get the following error.

    Notice: Undefined index: access in _menu_link_translate() (line 929 of /var/www/hosts/xxxxx/includes/menu.inc).
    Notice: Undefined index: access in _menu_tree_check_access() (line 1512 of /var/www/hosts/xxxxx/includes/menu.inc).

Pathauto seems to be working with menu tokens after disabling mobile switch...is there any patch or fix for this bug? Any help would be greatly appreciated!

rfc2460’s picture

Version: 7.x-1.1 » 7.x-2.x-dev

Hi,
I confirm the issue. I have the same modules: pathauto + mobile switch 7x-2.x-dev.
I also confirm that the issue disappears if I remove the call to drupal_alter in mobile_switch_boot.

rfc2460’s picture

Ok thanks to my colleagues, we may have an explanation (but not a solution ;)). The problem is really due to the call to drupal_alter in the hook_boot.

When drupal_alter is called, it probably loads a list of the modules that propose hooks (more precisely a list of functions) in cache (thanks to drupal_static). However, in the hook_boot, not all the modules are loaded. It is the case of the menu module that does not implement hook_boot and is then not loaded during the bootstrap. Pathauto relies on token module. When it tries to build the alias, the token module tries to get the menu name but its requests uses the cache in which the menu module functions are not loaded...

So the call to drupal_alter in hook_boot seems very hazardous and it should be rethought.

rfc2460’s picture

Priority: Major » Critical
Status: Postponed (maintainer needs more info) » Active

I change the priority since this issue may be very dangerous and pernicious. it probably has impacts on other modules than pathauto.

Mr.Echo’s picture

Has any progress been made on this issue?

xiukun.zhou’s picture

I also have this problem, I need help.

Ndesign’s picture

Issue summary: View changes

The content auto label module is broken with mobile switch as well.