Does not see term-raw first time

gettysburger - May 29, 2009 - 15:43
Project:Automatic Nodetitles
Version:6.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I am having titles generated when the title field is empty. I am using:

[term-raw] vs. [field_opponent-raw]

When I first save the node, the title is " vs. Cecil County"

If I then delete this title and save again I get the correct "Women's Basketball vs. Cecil County"

Any thoughts? Thanks.

#1

jhedstrom - July 13, 2009 - 22:57
Status:active» needs review

The attached patch resolved the problem for me. However, it is somewhat of a hack, as the root cause of this lies further down the token module chain.

AttachmentSize
auto_nodetitle.term_raw.patch 677 bytes

#2

lancelot - July 16, 2009 - 13:35

Thanx for the patch, but there is an error.

Instead of
+ foreach ($node->taxonomy as $tid => &$term) {
+ $term = taxonomy_get_term($tid);

Shoould be
+ foreach ($node->taxonomy as $count => &$term) {
+ $term = taxonomy_get_term($term);

#3

Tannerjf - July 16, 2009 - 19:18

I have this problem using the formatted [term] value as well, should that make any difference. Looks more to be a token/taxonomy issue.

#4

Tannerjf - July 16, 2009 - 19:38

This patch doesn't appear to work quite right. It will add a term to the title, but it's not the term that I applied to the node... it's not even a term in the same Vocabulary. I tried it with the change posted by lancelot, and the patch ceased to have any effect whatsoever.

#5

a.a.egoroff - July 18, 2009 - 19:05

EPIC FAIL:)
This patch converts (int) $term to (obj) $term… Vocabularies' fields become blank:) when node edit form refreshes e.g. on preview or on form validation error. It seem like core Token bug, not ANT.
Try this #338853: Token malfunction with Auto NodeTitle: [term] replacement fix patch — works for me:
D6.13
CCK 2.4
Views 2.6

#6

Tannerjf - July 19, 2009 - 00:37

a.a.egoroff, that patch did the trick! Thanks!

#7

jhedstrom - July 20, 2009 - 17:22
Status:needs review» needs work

#338853: Token malfunction with Auto NodeTitle: [term] replacement fix patch works for me as well.

 
 

Drupal is a registered trademark of Dries Buytaert.