Closed (fixed)
Project:
Automatic Nodetitles
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2007 at 09:47 UTC
Updated:
16 Feb 2007 at 21:30 UTC
I installed auto-nodetitle module and the token module but I haven't been able to have them working.
1. Do I have to wrap token values in special characters? ( what do I have to type in the pattern textarea to print the node id as title? ( nid, [nid], %nid or what?) )
anyway whatever I type on the pattern textarea (I tried some php code too) I'm having this error on node preview:
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/homeslee/public_html/drupal/includes/bootstrap.inc on line 589.
Any help appreciated.
Comments
Comment #1
dodorama commentedOk, I tried with square brackets and it works but I'm still having the warning on node preview (On submission the automatic title is correctly inserted).
And there are some problems with CCK date and node reference fields that aren't printed at all.
Comment #2
fagoWhat's your configuration for the automatic-title?
I've just fixed one issue I ran over with the node-preview (node->changed unset)
Comment #3
dodorama commenteddrupal RC 1
CCK 5.x-1.x-dev
automatic node-titles 5.x-1.x-dev
token 5.x-1.3
I enable automatic title for a CCK content type and then define a pattern like :
field_date is a CCK datefield,
field_artist is a nodereference field
and
field_venue is a textfield.
Only the textfield is correctly printed in the title field.
And whatever I use as pattern (even a simple string) I always have the error I mentioned above.
Comment #4
creazion_dev commentedSubscribing :)
Comment #5
aren cambre commentedCould these usage rules be documented somewhere? Nowhere do I see that you have to use square brackets to make this work.
Comment #6
creazion_dev commentedHi dodazzi,
I've the same problem. I think there can't be an nid because the node isn't saved at this time.
I use the following code snippet to get the nid:
print db_next_id('{node}_nid');IMHO there is only a problem if more than one user create a node at the same time
Comment #7
dodorama commentedI think the problem is caused by the token module.
I changed the function that generate the tokens for CCK fields and everythings seems to work now.
Please look at this post for instructions .
Comment #8
fagocould you try again with the latest token module release?
http://drupal.org/node/110210
Comment #9
Robrecht Jacques commentedI have a similar problem.
Drupal 5.0
Content 5.x-1.2
Date 5.x-1.0-beta
Number 5.x-1.2
Token 5.x-1.4
Automatic Nodetitles 5.x-1.x-dev
I have a content type where I would like a date inside the title, a date provided by CCK/Date and a number provided by CCK/Number. My configuration for auto_nodetitle is:
Booklet [field_number]: [field_date]The number is substituted correctly. However, the [field_date] always is replaced by "January 2007", even if I put "12/2005" as value for the field. In the preview of the node, CCK correctly sets "December 2005" as the value, but that value is not used in the title.
It seems like the node is not complete when doing
_auto_nodetitle_patternprocessor(). When CCK gets the node and does acontent_format($field, $item)the$itemcontains:while when auto_nodetitle does (or lets token.module do) a
content_format($field, $item)the$itemcontains:Any help appreciated.
Comment #10
fagoI've just committed some enhancements, please test and reactivate if the problem persists.
Comment #11
(not verified) commented