Closed (fixed)
Project:
Automatic Nodetitles
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2007 at 16:03 UTC
Updated:
16 Feb 2007 at 20:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
robertdouglass commentedTokens I am using: [field_last_name], [field_first_names] ([field_birth_date]-[field_death_date])
field_last_name = text (single)
field_first_names = text (multiple)
field_birth_date and field_death_date = date fields (CCK)
Comment #2
eaton commentedModules that need to to tag-stripping need to perform some extra processing on the token values they get from token.module. There's an example of how to do that in token.module's API.txt, if there's demand I might add an option for it (check_plain processing of replacement values, etc) to the core module.
Comment #3
robertdouglass commentedEasy enough to fix.
Comment #4
robertdouglass commentedcheck_plain is better.
This patch also addresses a separate bug (fago, if you need me to I'll open up another issue):
on the admin/content/types/{type}/fields page (Administer->Content management->Content types->edit->Manage Fields), the auto_nodetitle module thinks we are editing a node and thus tries to set the title (resulting in array_merge errors). This patch adds an extra check that clears this up. It's a bit hackish, so give it some thought to see if it could be better.
Comment #5
ray007 commentednot sure what went wrong (patch complained about having to use '-R'), but my new title now is:
<span class="date-display-single">Monday, 1. January 2007</span>Comment #6
robertdouglass commentedthanks for reviewing. I submitted and then realized how stupid check_plain is. I'm working on a different version.
Comment #7
ray007 commentedMaybe strip_tags() instead of check_plain() ?
And my last result seemed like a double-encoding, maybe we also need to reverse some check_plain() that happened before auto_nodetitle got it's hands on the data with htmlspecialchars_decode()?
Comment #8
robertdouglass commentedWell here is a patch the produces the correct results. strip_tags wasn't enough... I had to preg_replace out all line endings, carriage returns, tabs and so forth.
Some coordination is going to be needed with token.module on this, though. Wherever the line breaks are coming from, they're unwanted.
Comment #9
ray007 commentedyes! thanx, that works now.
btw: which version did you base your patch on? when applying, patch always complains
after answering "n" i get a second question
Apply anyway? [n]to which I answer "y", and than it works, I only get a one-hunk-reject on the id-line ...
now back to my basic problem of getting the wrong date, which is another topic ;-)
Comment #10
dodorama commentedI think this patch belongs to the token module as stated here.
Comment #11
fagothanks robert, patch committed to 5.x and HEAD.
Comment #12
(not verified) commented