Autonode title only runs when creating or updating nodes, therefore existing nodes will not be upgraded. Here's some background:
I have a content type with 25 CCK fields that did NOT have auto_nodetitle installed, but after assessing our existing nodes (all 13000), we decided to use auto_nodetitle to pull from a few of those fields so titles would be standardized. I have tested creating a new node, and auto_nodetitle works perfectly. However, does anyone know how to update ALL our existing nodes to implement this module?
Would this involve running a nodeapi hook for auto_nodetitle on every node? Hmmmm...
Comments
Comment #1
Anonymous (not verified) commentedOk, I just updated all my nodes using a simple SQL script, but this might be a great feature in the future... perhaps running a lot of invoke_nodeapi calls? PHP timeout anyone?
Comment #2
deekayen commented@kevee it would be nice if you attached your script so it could be added to a contrib subdirectory to the distrib tarball, or at least be found when this page turns up in search results.
Comment #3
fagoThere won't be any new features for 5.x any more.
Comment #4
smcguinness commentedkevee - How did you ultimately accomplish your task? We definitely don't have the 13000 nodes you have, but we have around 500, and I think 10 is too many to have to do by hand. Thanks.
Comment #5
doc2@drupalfr.org commentedInterested too in the feature.
Fago #3:
> Even if someone else helps maitnaining/developping? Or do you prefer that the module be a new one?
Comment #6
deekayen commentedI'm not sure what #5 means, but please, please don't fork to another module. There are already too many duplicated functionalities in the modules pool now. I'm sure with a quality patch, fago can be swayed. He's an active developer and your patch certainly wouldn't go un-noticed.
Comment #7
doc2@drupalfr.org commentedI share your point. I would prefer to keep one module. I just said that because sometimes developpers/authors have a certains idea of what their module will do and thus they often restrict/don't want new features (ex. with http://drupal.org/project/CCK_taxonomy)
I understand this but, on the other hand, patching on and on lower the reliability of the modules. Having no clues yet on the "roadmap" the Automatic Nodetitles module took and reading moreover the "postponed" status, I asked the question of a new module in case I find someone who agrees to (1) release stable versions (even if they still have a -dev version name, this doesn't matter) with all contributions commited by, say, the end of March from the drupal community, or by the end of June if we get internal resources to do so. Because unfornutenately, we don't have the competence yet. And of course, I don't want to impose my needs to developpers unless they enjoy those little challenges :)
(2) For infos as well, I reopened this feature request: #173614: Node Title Optional
(3) And I wonder about the compatibility with http://drupal.org/project/pathauto
Links to (i) related topics would be greatly welcome if you know well the issues around this great module! Greetings,
Arsène
Comment #8
fagoof course - If you provide a well written, clean patch for 5.x *and* an also well written port to 6.x, then I'd love to commit your work!
Comment #9
nruest commentedsoooo.....
did anybody figure out what the illusive sql script is?
Comment #10
nruest commentedhere is a solution:
function rename_titles_submit() {
$result = db_query("SELECT nid FROM {node} where type=''query");
while($nid = db_fetch_object($result)) {
$node = node_load($nid->nid);
auto_nodetitle_set_title($node);
node_save($node);
}
Comment #11
Anonymous (not verified) commentedWhere do you run the above code at?
txcrew
Comment #12
nruest commentedi just created a module. that is the function you can call for the module.
Comment #13
doc2@drupalfr.org commentedDear Nick, where to find your module or what's its name? Thanks in advance, Arsène
Comment #14
doc2@drupalfr.org commentedIs this code all what a new module needs? please just tell us some few more things to get started... how do you call this function?...
Comment #15
doc2@drupalfr.org commentedI tried to set up a new module:
But I got an error message on its last line (the one of the while closing bracket):
Parse error: syntax error, unexpected $end in /Shared Items/iDoc/drupal/modules/image_title/image_title.module on line 22PleeeeeaZe HeLp .!:
Comment #16
ali27 commentedi modified the module name look to the next comment
Comment #17
ali27 commentedit's a module autotitle for the automatic nodetitle
don't forget to create a module.info
Comment #18
fagoplease just create a patch for auto node title, which adds in this feature directly into the module. Be sure to follow drupal's code style (tabs!).
Comment #19
Miszel commentednruest,
You can update all the titles with a MySql query. Say, you have a content type called 'author' and you want to set the title to the author's first name and last name. If the first name and last name fields are in a table called 'node_author' (please check it!), you can run the following query in phpMyAdmin:
UPDATE node_author na
JOIN node n
ON n.nid = na.nid
SET n.title = CONCAT(na.field_first_name_value,' ',na.field_last_name_value)
WHERE n.type = 'author'
Comment #20
Gerald Mengisen commentedThis issue here could be probably closed due to the the patch in issue #321611: Batch update node titles ?
Comment #21
fagoyep.. :)