Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | auto_nodetitle.term_raw.patch | 677 bytes | jhedstrom |
Comments
Comment #1
jhedstromThe 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.
Comment #2
trofimchouk CreditAttribution: trofimchouk commentedThanx 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);
Comment #3
tannerjfco CreditAttribution: tannerjfco commentedI have this problem using the formatted [term] value as well, should that make any difference. Looks more to be a token/taxonomy issue.
Comment #4
tannerjfco CreditAttribution: tannerjfco commentedThis 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.
Comment #5
a.a.egoroff CreditAttribution: a.a.egoroff commentedEPIC 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
Comment #6
tannerjfco CreditAttribution: tannerjfco commenteda.a.egoroff, that patch did the trick! Thanks!
Comment #7
jhedstrom#338853: Token malfunction with Auto NodeTitle: [term] replacement fix patch works for me as well.
Comment #8
fripplo CreditAttribution: fripplo commentedI solved it by changing the order of module priority; the "Token" module needs to do it's work before "Automatic Nodetitles". This is how I did it:
1. Dowloaded, installed and activated "Module Order": http://drupal.org/project/module_order .
2. Added "after = token" (ex the quotationmarks) to /sites/all/modules/auto_nodetitle/auto_nodetitle.info according to instructions.
3. Went to "Administer > Site Configuration > Module Order" and pressed button "Rebuild Module Weights".
This worked fine for me. Don't really know if step 2 would make any difference or not (all module weights were rebuilt and wighted depending on their alphabethical position).
Note that "Module Order" is in dev. Don't forget to make backup your site before you try.
Comment #9
alliax CreditAttribution: alliax commentedFor me this module_order messed up my cck form because it changed ALL module weight in system table, and I have wasted so much time to find out that it was this action that messed it up.
And thanksfully I had a backup of my database from one day before, so I have been able to make a sql query to reset all module weight the same way as before.
MODULE_ORDER = NEVER AGAIN !
If I want to mess up with module order I will take a module which doesn't set all modules weight when I only want one module to be above another one. This is crap, I'm furious about doing this and wasting my time just to be back with my initial problem, but I'm happy that I have been able to find and solve the mess created by module_order otherwise I would be in a much more trouble than I am now with my small problem.
Now I will try to find another module to set the module weight (or maybe I should simply do it in the database instead of relying on a module which does what it wants)
sorry for the rant.
Comment #10
jeffreyvddb CreditAttribution: jeffreyvddb commentedSo... What is the right way to do this? The patch isn't working and the module 'Module Order' is messing up databases.. Any suggestions?
Comment #11
bdimofte CreditAttribution: bdimofte commentedWell, you can set the weight yourself in the database.
Or better yet, write the query in a module's install file:
Comment #12
jeffreyvddb CreditAttribution: jeffreyvddb commentedI changed the weight of the auto_nodetitle to 11. Token has weight 10. On submission of a new node, the title still isn't generated.
Because the fields come from the 'Location', which is another module, I changed the weight of all the .module files related to 'Location' to 12. But still no result.. Tried to clear the cache, but that didn't work either. Any suggestions?
Comment #13
nlambert CreditAttribution: nlambert commentedsubscribing
Comment #14
alexbk66- CreditAttribution: alexbk66- commentedsubscribing
P.S. To change module weight use Util module http://drupal.org/project/util, it's Drupal, remeber?
Comment #15
alexbk66- CreditAttribution: alexbk66- commentedActually, this is duplicate issue, but the other one does have a workaround:
http://drupal.org/node/373978#comment-1654702
Comment #16
aubjr_drupal CreditAttribution: aubjr_drupal commentedGo to my summary on available hacks/fixes as of this posting for this problem. I put it together after coming across a lot of posts on this issue and wanted to summarize it for others.
Comment #17
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commented