In the settings I have:
* Create a new alias, replacing the old one
* Patern for pages: pages/[catpath]/[title]
* verbose off
* create index off

When titles of pages are changed,
When category names are changed,
Actually everywhere when titles or names are chaned:
the path is not changed...

Basic 470 install with modules: banner, captcha, dutchstemmer, scheduler, tinymce

Comments

shane birley’s picture

I have experienced this as well. With new nodes the paths are not created.

shane birley’s picture

Possible Solution

I removed the module files and then reset the module. (re: I deleted the pathauto.module reference in the system table) This seems to have cleared up the issue. I will report any problems.

This seems to be a problem from an earlier version of pathauto.module 4.7 to more recent versions.

shane birley’s picture

The problem is back. No error messages anywhere. Argh!

Anonymous’s picture

Other than the not-updating problem mentioned above, something else I noticed after upgrading the module to the most recent version:

It used to be that when editing a node, if I delete the old url alias in the little alias bar and update, pathauto will automatically generate a new url alias. Now when I do this, the url simply becomes (or "goes back to") "/node/123".

ricmadeira’s picture

Yeah, I'm getting this too: when I edit nodes and erase the pathauto URL to get a new one, no new URL is created (like it used to happen), and the node is stuck with a node/123 type link. Is it suposed to work that way now, or is this is a bug?

cbow’s picture

I'm getting this too. Aliases are not being updated.

Pathauto v 1.22.2.4

cbow’s picture

It seems like pathauto_node.inc::pathauto_nodeapi isn't being called node on update. Can anyone else confirm this?

shane birley’s picture

An update to what I have been experiencing:

- posting content via Drupal is working with minor URL creation failures (apparently random and no errors are generated, the URL aliases are just not created)
- but via a blog client, the URLs are never created

FiReaNGeL’s picture

Experiencing this too with the latest version, nodes saved programmatically don't update their paths, and paths for my custom node type now only incorporate the title...

knseibert’s picture

@7: Yes, i can confirm this. Running Drupal 4.7 and all current versions of pathauto and category (including category_pathauto). pathauto_nodeapi is not called on node (category) update.
Still debugging ....

knseibert’s picture

Any ideas what could be causing this?

greggles’s picture

Component: User interface » Code

I haven't had the time to look into this yet, but there have been some updates in the last month to the code trying to fix other problems which may have introduced this regression.

When I have some time I'll take a look into what could be causing it - if anyone wants to jump ahead of me my first step would be to add a line to watchdog to see if the nodeapi is getting called and what variables are in it at that time (which should hopefully lead to finding the problem...).

knseibert’s picture

Hi again,
i have set up the following line within the pathauto_nodeapi function of pathauto_node.inc:

drupal_set_message('pathauto_nodeapi: '.$op);

Creating a node gives creates this output:
# pathauto_nodeapi: prepare
# pathauto_nodeapi: validate
# pathauto_nodeapi: submit
# pathauto_nodeapi: insert

But updating the same node gives no output at all.

Deleting the node calls pathauto_nodeapi twice:
# pathauto_nodeapi: load
# pathauto_nodeapi: view

I have also tried it with the category module disabled, but there was no change.
Any further ideas?

cbow’s picture

If I move the pathauto_nodeapi function from pathauto_node.inc into pathauto.module everything works fine.

cbow’s picture

StatusFileSize
new44.15 KB

To follow on whith knseibert discoveries:

On update pathauto_nodeapi is not added to the module.inc $implements array, this can be seen in the attached debugger screenshot.

knseibert’s picture

StatusFileSize
new944 bytes

Another way would be to implement an init hook.
Patch is attached. The update hook is then properly called.
Nevertheless, it still isn't working for me. It seem like pathauto creates the alias, which is then several sql queries later deleted. I could trace it back to the path.module's update hook in which path_set_alias is also called, but with $node->path being empty at that time resulting in the deletion of the just created alias.
Again, i'm using the category module. Not sure if that conflicts!?

bwynants’s picture

this fixes creation for me not updating...

zaphod280380’s picture

If I move the pathauto_nodeapi function from pathauto_node.inc into pathauto.module everything works fine.

this works for me! thanks

knseibert’s picture

Status: Active » Needs review
StatusFileSize
new700 bytes

Calling path_nodeapi($node, 'load', ''); from within pathauto_nodeapi::update fixes the update issue for me. Patch is attached. With this and the patch from #16 everything works as - i think - it should.

greggles’s picture

StatusFileSize
new1.42 KB

@knseibert - thanks very much for the detective work that figured this out.

Your method does seem to solve the problem but it breaks the modularity of pathauto.

I looked back at http://cvs.drupal.org/viewcvs/drupal/contributions/modules/pathauto/path... to see if any of the commit messages/issues that have been fixed around the time of this issue seemed like the could have caused code from pathauto_nod to NOT be included and http://drupal.org/node/60526 seemed like the likely cause.

Indeed, I tested reverting that patch and updating nodes seems to work again. So, I think the best solution is to move those include_once calls back outside of the hook_menu.

Attached is a patch to do this - please let me know your thoughts but I'll plan on doing this shortly because it was working for a while already in this mode.

Also, moshe's main complaint and the reason for moving it into hook_menu was because of the use of the file_scan_dir which is apparently a greedy thing to do on every page load. My preference is for hardcoding the filenames rather than doing the dynamic include - I'd appreciate comments on the issue about dynamic vs. hardcoding of these include files.

knseibert’s picture

Hi greggles,
i have reverted to your original pathauto module version 4.7 and applied your patch.
Again, everything works except the update functionality. When moving a node within my categories from a/b/c to a/c i get the following message:

Created new alias a/c for node/54, replacing a/b/c

However the alias still is a/b/c. I figured, that for a short time the new alias is set, triggering the displayed message. Later during the update process path_set_alias is called within path_nodeapi (case update). At that time $node->path still has the old value, resulting in overwriting the new alias with the old one.
See #16.

Same thing without categories.

#19 fixes this problem for me.

Perhaps i am misunderstanding the concept of it all, but should'nt $node->path be updated as well?

knseibert’s picture

On the other hand, if it is all working for you... maybe it is category related and i just have not tested correctly.

greggles’s picture

@knseibert - thanks for the test.

The user messages are pretty disjointed from the actual creation of aliases - so if you see something in the UI that is misleading, that's not surprising.

But, the bottom line is that this is not working for you - which is a problem. One question, was pathauto ever working for you?

It could be that we have a regression and a separate issue that we've been dealing with together because they have the same symptom.

knseibert’s picture

@ greggles
Actually, i'm not sure. I've only started using pathauto and category_pathauto a couple of weeks ago and only on a test setup. As far as i could tell then it worked, but i only created content for testing. Now as i started to fill the homepage with content and moving categories i realized, that the update functionality is broken.

petrescs’s picture

I have experienced this issue as well (on a 4.7.3 install, using pathauto module version 1.22.2.8, downloaded on 18th Oct from project page). After I have applied greggles' patch mentioned at #20, the nodes aliases are now updating as expected.

shane birley’s picture

I installed the latest version (from yesterday, Oct 19) and the problem still exists. I will install the patch today and let you all know the result.

greggles’s picture

Thanks, shane. And since we're possibly tracking two different bugs here please let us know if you use category_pathauto module as well.

shane birley’s picture

I am currently not using category_pathauto - I can try it out and see what issues come up.

cbow’s picture

The patch from #20 works for me.

Modules: 4.7.4, Pathauto 1.22.2.8, CCK, Views, Devel

shane birley’s picture

I patched pathauto with #20 and - yay! It appears to work. I have made successful updates through the Drupal interface and through two different blogging clients. I will keep track of it over the next week. Otherwise, looking very good at this point.

greggles’s picture

Status: Needs review » Fixed

so, I applied the patch from #20 to both CVS and HEAD - since it fixes the problem for many people.

@knseibert - can we continue our discussion in a new issue that is specifically geared towards your situation?

It would be helpful if you could open a new issue with
1) the list of modules you have enabled
2) a summary of your investigation from this issue (not necessary, but would make discussion easier)

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)