Pathauto generating incorrect date and time for alias if no permission for 'administer nodes'
venkat-rk - December 21, 2005 - 03:26
| Project: | Pathauto |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | mikeryan |
| Status: | duplicate |
Description
Well, what actually happens is that when I put [cat]/[eventdd]/[eventmon]/[eventyyyy]/[title] as the pattern in node path settings (category path settings is simply [cat]) for a flexinode event type, it generates aliases where the year and date are always 31st Dec 1969, even though the correct date and time are set in the node.
When I open the same node from administer>>content>>edit and simply save it it again, it generates the correct alias. Killes confirmed that he does not use pathauto (;-)) and that the event module does not implement the pathauto api.
Is this an event module or pathauto bug?

#1
I've had the same problem. I think the path is getting set before the date values are being set/saved.
#2
I can't reproduce this issue with the current 4.6 version of pathauto, and event.module revision 1.122.2.19, the alias is correct on node creation. What version of the event module are you using?
#3
I found that bug also.. it is not related to event-module(s) anyhow. I don't have those installed and I can reproduce the bug:
1. create new user, let's call it xxx.
2. xxx has role: 'authenticated user'
3. give that role permission to create stories and edit own stories (and 'create url aliases' but I'm not sure this will affect..).
4. log in with new user xxx.
5. create content -> story
6. fill in the title and the body and submit.
7. It will say something 'Created new alias news/2006/testnews for node/60'.
8. now edit the created story and press submit.
-> message will say something: 'news/1970/testnews for node/60, replacing news/2006/testnews'
my pathalias configs:
Update action: Create a new alias, replacing the old one.
Default path pattern: this is empty.
Pattern for all story paths: [catpath]/[yyyy]/[title]
nasty workaround:
give the role 'authenticated user' permission to administer nodes -> the dates and times in pathalias will be correctly created next time you press submit.
Ask if you need more info or my configs..
#4
Kimpsu,
Mikeryan no longer maintains pathauto. Kbahey agreed to take on some minimal responsibility for keeping the module going (mainly, upgrading to 4.7), so I don't know if this bug will ever be fixed. But, thanks for sharing this. At least I know it was not due to some fault of mine.
Ramdak
#5
Mikeryan no longer maintaining! argh no.
This bug is happening for me too, using the latest CVS version of pathauto with Drupal 4.7
#6
Can confirm that this bug also happens for me.
Dec 31, 1969.
Yuck.
#7
This is an error due to some shoddy coding in pathauto_node.inc, and occurs only when you bulk update the node aliases. Instead of loading the nodes properly, it is just running a database query on the node table, which does not include event and other module information.
To fix the problem, find the node_pathauto_bulkupdate() function, and add the following lines right after the
while ($node) { line:
$fullnode = node_load($node->nid);$fullnode->src = $node->src;
$fullnode->dst = $node->dst;
$node = $fullnode;
Then the node will contain all the node data from other modules, including the event feilds.
#8
@mcaffry - any chance you can provide a patch?
http://drupal.org/diffandpatch
#9
Here is a patch to make the bulkupdate function work with events and other node module data.
#10
marking as a dup of http://drupal.org/node/69789
Mccaffry, thanks for your effort on this. If it weren't for the order in which I attacked the issues then this one would be the one I'd be applying (more or less).
#11
Heh - forgot to actually change the status.