I want to have an arrangement whereby I can switch off the default label in the cck display settings and have a default "intro" for each type that this field instance is used in, based on the settings per type. (I just noticed I can't do that, but I'll get round it - this problem actually occurs in global settings)
To that end, I configured a link field with link title set to "static", with a value of "More info: [field_link-view]". See http://dl.getdropbox.com/u/72790/static_tokens.png
My desired result would be something like: More info: <a href="some.gif">This is the link title</a>
This completely fails to work, however. What I actually get is this! http://dl.getdropbox.com/u/72790/static_tokens2.png - a link that's rendered with the name of the token as the title (token has failed to render) AND the text is rendered twice!
| Comment | File | Size | Author |
|---|---|---|---|
| #44 | screenshot-link-date-repeat.png | 110.4 KB | romansta |
| #44 | screenshot-link-date-repeat-2.png | 107.8 KB | romansta |
| #37 | link-DRUPAL-6--2_462538_optimized.patch | 1.77 KB | dboulet |
| #23 | link-462538-23.patch | 1.77 KB | tim.plunkett |
| #16 | link_462538.patch | 1.79 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettI tried to set a static title to [title-raw], and it comes out as [title-raw]. I could have sworn it worked before, but I can't pinpoint when it stopped working or what changed.
Using link 6.x-2.x-dev and token 6.x-1.x-dev.
Comment #2
tim.plunkettFound it! The culprit was the patch from #715682: Replace Tokens is forced in _link_sanitize(). $field['enable_tokens'] claims that it "will allow users to enter tokens in URLs and Titles on the node edit form" and that it "does not affect the field settings on this page", and yet Static titles won't work without enabling it.
Only the second half of that patch was correct. Here's a patch fixing the first half.
In every case, the token module needs to exist. But tokens should be processed in two scenarios: if the Static title is set, or if the Enable Tokens checkbox is checked.
Or, the Enable Tokens checkbox needs to state that for ANY tokens to be processed, it needs to be checked.
Comment #3
manuel garcia commentedPatch #2 applied fine, and is working as expected, in my configuration I have it setup to 'Static Title', and using the [title] token in it. Before the patch it would not substitute it for the node title, after the patch it works, also tested with other tokens to see.
Comment #4
catofcheshir commentedI lost my titles after upgrade to 2.9. Apply patch #2 manually - yes, it's work again!
Comment #5
tim.plunkettComment #6
cerup commentedConfirmed; Same problem here. #2 fixes it.
Comment #7
metastate commentedUpgraded to 6.x-2.9 and tokens stopped working. Patch in #2 fixed it.
Comment #8
haikubear commentedCan confirm bug in 6.x-2.9, Patch in #2 worked for me as well.
Comment #9
jcfiala commentedAgreed.
The problem here is that I made a change to how the admin-entered tokens are handled, and I didn't entirely think that through. This is a good patch, and I'll be applying it later.
I'm renaming this issues so I can point the other duplicate issues at this.
Thanks folks, and I apologize for screwing this up.
John Fiala
Comment #10
jcfiala commentedamending the title, upping the priority so I don't miss this.
Comment #11
rkendall commentedGlad to see this is being looked at. I thought I was going going crazy there for a minute :-)
Not sure if the patch is working for me, I still need to check the "Allow user-entered tokens" box to have a token work in the "Link 'title' Attribute" text field. (I don't want to have 'user' entered tokens, just 'admin' entered tokens in the field definition).
Thanks.
Comment #12
jcfiala commentedIt's entirely possibly that the patch does not cover all the locations where admin-entered tokens go, as opposed to the user-entered tokens go. I welcome a more comprehensive patch, but even if I don't get one I'll be sure to double-check my admin fields to make sure they all work with 'Allow user-enterted tokens' turned off.
Comment #13
Shai commentedI had the problem as described by many.
I applied the patch in #2.
It fixed the problem.
I'm really hoping that his patch can be committed very soon; at least to the dev version. I use Link on many sites and I don't want to have to apply the patch in each case. I just want to use drush to update.
Thanks for the great module.
Shai Gluskin
Comment #14
finex commentedsubscribing
Comment #15
tim.plunkettSo it seems that
$field['enable_tokens']now is specifically for user-entered tokens, so all of the references to it had to be optional, or in the first case in the patch, removed altogether.Please test!
Comment #16
tim.plunkettWhoops, missing a parenthesis. Sorry!
Comment #17
Shai commentedI experienced the problem described here while using link-6.x-2.9
I applied the patch provided in comment #16
It applied cleanly
It fixed the problem
Shai Gluskin
Comment #18
dnewkerk commented+1 on patch in #16. Tested and it works great :)
Comment #19
tim.plunkettComment #20
Anonymous (not verified) commentedpatch #16 works for me.
Comment #21
dboulet commentedThanks for the patch, works well.
Comment #22
thill_ commentedpatch #16 works for me.
Comment #23
tim.plunkettRerolled after bangpound moved everything around :)
Comment #24
summit commentedHi,
For me tokens are still not working, also not with this patch. Could it be that I have a panel for the node-form (panels overrides the original nodeform (www.drupal.org/project/panels)?
If you want me to make a new issue of this, I'll be happy to do this. Sorry then for this post.
EDIT: It is definetely a cck link <-> panels issue. Made a new issue: http://drupal.org/node/897330
Greetings, Martijn
Comment #25
xjm#16 resolved the issue for me with 6.x-2.9.
Comment #26
obsidiandesign commented+1 for the patch in #23 with 6.x-2.9.
Comment #27
daniel-san commented+1 for the patch in #23 on 6.x-2.x-dev.
Extra feedback: Was trying to test on link-6.x-2.9, but the patch stopped because there was no link.inc file in the module folder.
Comment #28
tim.plunkett@daniel-san, the patch in #16 is identical in functionality but applies to 6.x-2.9.
The patch in #23 still applies to 6.x-2.x!
Comment #29
tim.plunkettThe module is completely unusable for many use cases without this patch, which was posted 4 months ago, with a re-roll 2 months ago. Please commit this.
Comment #30
Sylvain_G commentedSubscribe
Comment #31
lucascaro commented+1
patch #16 applied greatly to 2.9
thank you!
Comment #32
kiero63 commentedI still have a problem with the "Link 'title' Attribute". I use Link 2.9 et dev version, I apply patch but nothing works. In case i don't apply patch my tokens are visible as they were entered and after patch, I see nothing. Is possible that they a problem with others modules ?
Thanks
Comment #33
tim.plunkett6 months of RTBC.
Comment #34
summit commentedHi,
Yes +1 for committing patch.
greetings, Martijn
Comment #35
Shai commented+1 for committing patch.
Comment #36
mfer commentedThis patch needs some work. The module_exists() calls should be the last part of the if () statement. Checking a value in an array is much faster than making a call to module_exists. Even for the cases where everything inside module_exists is cached it's still slower. Performance matters.
Comment #37
dboulet commentedNew patch optimized as per #36.
Comment #38
carvalhar commentedhi,
i think this checkbox should be checked automatically if static is marked with token.
This is a better option for UX.
Comment #39
dboulet commented@carvalhar, that could probably be dealt with in another issue, this is about fixing the bug.
Comment #40
tim.plunkettThanks mfer and dboulet.
carvalhar, please open a separate feature request for that, this is an actual bug.
Comment #41
James-TRMS commentedThank you for this module - it could be fundamental to a significant functionality on one of my sites.
However, have applied patch #16 to 2.9 and works fine using Static Title with [field_myfieldname-url] for a single entry but when using "Add another item" the new item's url is correct but the title shown is the title from the first entry. Ditto the title attribute.
Am quite new to Drupal, CCK and this module am I missing something?
Comment #42
jcfiala commentedOkay, I've now committed this change - give a try with the new dev release that should roll out tonight and let me know.
Comment #43
fadgadget commenteddev release sorting this out nicely for me jc with no problems so far. thanks
Comment #44
romansta commentedIf I use 'User Entered Tokens' in 2.9 or the dev-Version with this patch applied, the Repeat Rule of the Date-Module (6.x-2.7) is not showing anymore.
Sounds strange, but look at the screenshots.
Before you ask: I tested it also- unlike in the screenshot - without any other cck-fields on a fresh content type made with the date wizard.
Any ideas?
Comment #45
romansta commentedChanged Status
Comment #46
ericm commentedlatest dev release fixes the problem for me
Comment #47
vunger commentedMe too.
Comment #48
dqd