Closed (works as designed)
Project:
Automatic Nodetitles
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2008 at 21:23 UTC
Updated:
18 Apr 2011 at 14:31 UTC
I have a node that requires the selection of a term.. I haven't been able to get Automatic Nodetitles to properly display the [term] name, nor the [id] either.
I have it set as the following: [type-name]: [hierarchyparenttitle-raw] ([term])
The final output is to be something like: Cover: The Pianist (North America)
I'm running Drupal 5.7.
Comments
Comment #1
mr_dimsum commentedI forgot to mention my results.. Basically the term field is just left blank.
Example: Cover: The Pianist ()
Regards!
Comment #2
jenna.tollersonI'm able to reproduce this. If I re-edit and re-save the node, [term] is filled in at that point, so the failure is at node creation.
I believe this has something to do with the title being generated before $node exists. I think this is by design? You might want to use php and
global $form_values;. This comment helped me.Comment #3
gaele commentedThis is broken, even if by design.
1. Create a content type with auto node title set to [term]
2. Create a node and tag it "North America". The title will be empty.
3. Edit the node and change the tag to "Europe". The title will be "North America".
Not very useful.
Comment #4
gaele commentedmr_dimsum, to solve your problem put this in the auto node title box instead of [term]:
(where 1 is your vocabulary id).
Of course this doesn't solve the underlying problem in this module. I guess more tokens won't work.
Comment #5
scedwar commentedI also have a free tagging vocabulary field on a cck content type that I'm using to generate the title of the node. If the vocab (it is optional) is not entered the token name is displayed on the page, in my case
"First part of title and then [field_vehicle_model_spec-term]"
For the moment I've removed the token and can live without it, but would love to see this fixed.
Comment #6
fagothis is, because the token integration fails the first time. The node just looks different, when it isn't saved. Look up token issues.
Comment #7
svihel commentedHello,
did you solve this problem with Free tagging?
Comment #8
scedwar commentedIndirectly. I made sure that something was always entered for both fields! ;-)
Comment #9
psynaptic commentedI was having the problem where titles did not get set using tokens or even the code in #4.
I ended up getting it to work using the data in the node object:
print array_shift($node->taxonomy['tags'])Edit: Don't do this unless you want your tag to not be saved in $node->taxonomy.
Comment #10
stormsweeper commentedI'm pretty sure you don't want array_shift unless you actually mean to remove the tag from the node.
For free tagging (presuming single values):
I'll presume you know the vocabulary you want to grab the term from.
Comment #11
psynaptic commented@stormsweeper: You are correct on both counts. I only realised the other day that array_shift was causing the tag to drop off the front of the array and leaving the taxonomy empty.
Thanks for posting the correct code. I have updated all my auto nodetitles.
Comment #12
svihel commentedBTW if you want to use freetagging I already found an solution - http://drupal.org/node/373978
Comment #13
Stomper commented[nid] and any content type [field value] in autonodetitles also don't work. In this instance it needs to be resaved twice, once for the [field value] and one for the [nid].
See http://drupal.org/node/1130694 : Issue queue seeking built in node resave options