Closed (duplicate)
Project:
Automatic Nodetitles
Version:
6.x-1.2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 May 2011 at 21:05 UTC
Updated:
16 Jun 2011 at 12:31 UTC
hello,
how to change a node's title after he was created by auto_nodetitle ?
regards,
Comments
Comment #1
kevinquillen commented+1. In my case, Automatic Nodetitles controls content profile node type titles, based on first and last name. If someone changes those fields, the title does not update.
Comment #2
LeMale commentedno one can answer this ?
Comment #3
kevinquillen commentedIt should work here:
Or does presave not work as good as insert or update?
Comment #4
kevinquillen commentedDoes anyone have a fix here?
Comment #5
pabloid commentedsubscribe
Comment #6
vm commentedadminister -> content
use the drop down to update node titles IIRC
running cron.php may also take care of this based on my minimal tests.
Comment #7
kevinquillen commentedThis does not work for sites using Content Profile and a user updates their profile, and that node title is based on first + last name, for example. They won't have access to that. It needs to happen when they save the node.
Comment #8
vm commentedThere are other issues explaining why it doesn't work on node save, not just for content profile but upon node save for any content type.
Marking this issue as a duplicate of:
http://drupal.org/node/1130694
http://drupal.org/node/1022714
http://drupal.org/node/1046666
http://drupal.org/node/373978 which includes a possible solution using rules.module found here: http://drupal.org/node/373978
granted the other issues are using different tokens than those mentioned in this issue but the resulting issue is the same. There are other more, descriptive issues and forum threads. Some indicate that because the title is the first field it's already saved before you get to the fields below it. Some more research would be required and legwork needed I'd think.
Following up in one of the issues filed previous to this one may aid.
I have cron run regularly with a cron job which seems to correctly change and save the tokens in the node title albeit not during the saving of the node itself. Perhaps using some php code as the project page states "Advanced users can also provide some PHP code, that is used for automatically generating an appropriate title." ? I've never tried to combat the issue in that way though.
Good luck.
Comment #9
kevinquillen commentedI got around it with my own hook_nodeapi- this worked for me, YMMV.
I think this might not be necessary if this function is changed:
By removing !empty($node->title) check, my update case is no longer needed in the hook_nodeapi of my custom function.