After enabling pathauto on an advanced project, I realised that the usual checkbox in the "path" tab was missing and that aliases were not generated.

Digging a lot, I found that core function path_form_node_form_alter was called after pathauto_field_attach_form what caused the if (!isset($form['path'])) condition to fail.

I have been using pathauto for a lot of projects without any problem but I cannot figure why this is hapenning. I looked at the modules' weights in the system table and I found the issue here.
For an unknown reason, all my core modules had been weighted to 15 so they were called before and causing the issue.

Here is a patch to avoid this.

Best regards.

pathauto-better-weight-on-install.patch723 bytesDuaelFr
PASSED: [[SimpleTest]]: [MySQL] 316 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


Dave Reid’s picture

This is very very very strange and the larger issue here is why your core modules had their weights changed.

DuaelFr’s picture

Yes it is, but this trick I put in the patch is used by a large number of modules which can be exposed to the same kind of issues (not with core modules in general), so I think it is safe.

Out of subject : the more surprising thing is that on my staging server, deployed with drush and features, all the core modules have a weight of 5... not 15...

Dave Reid’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm still not sure we can support this. Path module is always assumed to have a weight of 0 by core.

DuaelFr’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I found that one of my contrib modules was buggy and was changing the core modules' weight upon installation. So this patch is no longer needed. Thanks for your time Dave.

Dave Reid’s picture

Ooooh, which module was it? I need to shame them.

DuaelFr’s picture

Nobody's perfect. I don't remeber which one it was but I think I found a patch in the issue queue that has been commited later.