node_pathauto_bulkupdate in pathauto_node.inc uses $node=db_fetch_object($result);

therefore events are not fully loaded and $node->event_start is not initialized correct when event_pathauto_node is called and placeholders eventday eventdd ... are all initialized at 1 jan 1970 when using 'Bulk update node paths' in the settings panel

node_pathauto_bulkupdate should use node_load ($result->nid)

Comments

cooperaj’s picture

I've had to use this patch to get my events to bulk update. This problem also affects og.module pathauto integration for the exact same reason.

+1

greggles’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.23 KB

This looks good to me. I made one slight change to the query so that it only brings back the nid. This should help performance by a tiny little bit.

Marking RTBC and will commit in the next few days.

Thanks very much Bert and cooperaj for your assistance!

greggles’s picture

Status: Reviewed & tested by the community » Needs review

Consider http://drupal.org/node/41918 which has a slightly different patch. It does a src/dst reassignment which is worth testing.

greggles’s picture

Also, use a table prefix on the select to fix http://drupal.org/node/70713

greggles’s picture

StatusFileSize
new1.28 KB

And here's a patch including the column prefix n.nid and after investigating the assignment of $node->src and ->dst to the new node object, I don't think that actually does anything so I skipped it.

greggles’s picture

StatusFileSize
new1.36 KB

So, I just realized that we probably DO need the src and dst because node_load only pulls one value from the DB, but not all values. Pathauto probably needs to know all aliases to do it's job right.

This patch merges the ideas of the three linked nodes. I think it's probably good to go.

jvalletto’s picture

Hi,

I would like to inform you that the above patch fixes the issue found here: http://drupal.org/node/84353

Thanks for your hard work,

Jeremy.

greggles’s picture

@jvalleto - thanks for the test and reporting back.

Just to be clear, can you let us know your settings in the "general settings" area.

Thanks again.

Greg

jvalletto’s picture

Sure no problem.

Verbose - Unchecked
Separator - [-]
Max Alias - 128
Max Component - 128
Create Index - Checked
Bulk Generate - Checked
Update Action - Create a new Alias replacing the old one.

Hope that helps.

Jeremy.

robomalo’s picture

http://drupal.org/node/84353

I created the thread above. I should have done some more research before creating it. Yes, the patch worked wonderfully! Thanks so much!

greggles’s picture

@robomalo - can you please also let us know your settings in the "general settings" area.

Thanks for the feedback that this patch works for you.

robomalo’s picture

Verbose - Checked
Separator - [-]
Max Alias - 128
Max Component - 128
Create Index - Unchecked
Bulk Generate - Unchecked
Update Action - Create a new alias, replacing the old one.

Thanks!

sun’s picture

Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.37 KB

The patch successfully fixes paths for cck and event nodes.
Attached patch corrects table aliasing in SQL query. I've chosen 'p' for path instead of 'u' since 'u' is mostly used for user.

greggles’s picture

Thanks for the test, sun.

What are your "update settings" under "general settings"?

Thanks.

sun’s picture

Verbose - Checked
Separator - [-]
Max Alias - 128
Max Component - 128
Create Index - Unchecked
Bulk Generate - Checked
Update Action - Create a new Alias replacing the old one.

Also tested:
Update Action - Create a new alias in addition to the old alias

OT:
btw, option "Create Index" doesn't make sense to me anymore as long there is no Views integration.

greggles’s picture

Thatnks for the additional testing, Sun.

There are multiple issues related to index aliases. I have no idea who might use these. I'd like to get rid of them AND get rid of the /pathauto/node/{wildcard} functionality all at the same time because I see them all as related to displaying nodes and not just creating aliases. Pathauto creates aliases...that's it. That said - let's keep this discussion as on topic as we can. Please feel free to open an issue for "remove index aliasing functionality" - I'd love to hear some debate on the topic.

greggles’s picture

Status: Reviewed & tested by the community » Needs review

Also - unless the maintainer of a module has told you otherwise please don't change the status to RTBC (and if you've been told otherwise, at least in Pathauto that's the way Steef & I like things).

greggles’s picture

Status: Needs review » Fixed

Committed to 4.7 and CVS-HEAD - thanks, everyone!

Anonymous’s picture

Status: Fixed » Closed (fixed)