After some time of adding content a pattern for node title has changed.
It would be great to have an option to mass update all existing nodes with the new pattern.
Auto path has this option in /admin/content/node menu.
(Look at the 'Update options' dropdown)
Is there a way to achieve this?

Thanks, Ronald

CommentFileSizeAuthor
#8 AutmaticNodetitles-321611.patch1.31 KBGerald Mengisen

Comments

fago’s picture

I agree that this would be a nice feature, anybody?

Gerald Mengisen’s picture

I'll look into this; I've needed this too often myself. I'm relatively new to Drupal development, so this might take a while.

moshe weitzman’s picture

This can be done with views bulk operations module once we commit #348860: Operate during nodeapi('presave'), not node form submit handler

alex72rm’s picture

Nice? It should be a *wonderful* feature! (I have more than 700 old contents to update!)

I noticed that it's necessary to automatically update only the title...

fago’s picture

The mentioned issue has been fixed in the dev branch - so please test the method described.

alex72rm’s picture

I'm trying the new -dev version, but I don't find how to batch update node title.

Can you explain?

Thanks a lot,
Alessandro

Gerald Mengisen’s picture

Same here, I don't see any code that would allow the bulk update neither in 5.x or 6.x

Gerald Mengisen’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

I had some time at hand, so I looked into this a bit more. Here is a patch against the 5.x branch of the module. Please have a look (also if the patch format is correct; I'm not used yet to CVS).
Thanks,
Gerald

P.S. (edit): Note that the node only gets saved if the newly calculated title is different from the old one.

moshe weitzman’s picture

This patch is sort of not needed anymore, since titles are recalculated during nodeapi(presave). If you do *anything* on the admin/cotnent/node or in views bulk operations, you will get your new title

rokr’s picture

I tried to unpublish/publish some nodes on admin/cotnent/node. Node title didn't change to the new pattern.
(using dev-version 2008-12-31)

Gerald Mengisen’s picture

Moshe,
Thanks for your feedback. The two patches are not mutually exclusive; I'd be happy if both were accepted (I can also create a patch for D6). If I just want to update node titles, I can run the explicit action, otherwise I know now that any other action will update them, too. It would be odd if I had to unpublish/republish nodes just to update the node title.

moshe weitzman’s picture

Yeah, I'll agree that it would be reasonable for ANT to offer a node operation that secretly did nothing but mark the node for saving.

rokr’s picture

Gerald, thanks for the patch. Works great for me. Exactly what i was looking for when i opened this issue.
You can also use it with View Bulk Operations as moshe mentioned. Perfect!

cheers, Ronald

rokr’s picture

(Comment deleted, double entry)

fago’s picture

Status: Needs review » Patch (to be ported)

thanks, I've just committed it to 5.x-dev - however I forgot to give you credits for your patch. SRY!

I've fixed a code style issue: it's if () { - please watch out for that.
A patch for d6 would be great.

patchak’s picture

Just to make sure, is it now possible to bulk update the titles with the dev version for Drupal 6 as well, or we are still waiting for the patch mentionnedi in comment no. 3 to get in??

Patchak

Gerald Mengisen’s picture

Patchak,
I'll be creating a D6 patch for the bulk update in the admin section as requested by fago in comment no. 15. It's going to take me about a week from now (I have first to set up the D6 test environment).

KG2’s picture

subscribing

Gerald Mengisen’s picture

Patch for Drupal 6 created here: #360359: Batch update node titles (for D6)

fago’s picture

Status: Patch (to be ported) » Fixed

I've backported the fixes from 6.x - see #360359: Batch update node titles (for D6) to 5.x-1.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.