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.
If Static Title is set in the field settings, but the field/url are optional, the Static Title is displayed on node view even if no data is ever entered.
I think nothing should show if nothing is entered.
Comment | File | Size | Author |
---|---|---|---|
#17 | link-if-empty-1136802-1.zip | 548 KB | Last Call Media |
#1 | if-empty-1136802-1.patch | 684 bytes | Last Call Media |
Comments
Comment #1
Last Call Media CreditAttribution: Last Call Media commentedComment #2
Last Call Media CreditAttribution: Last Call Media commentedComment #3
acouch CreditAttribution: acouch commentedThis patch worked for me.
Comment #4
acouch CreditAttribution: acouch commentedComment #5
jcfiala CreditAttribution: jcfiala commentedSo, I'm not sure about this one. It's worked this way for a while, it works this way in Drupal 7's version, and I've even got a test (testOptionalUrlStaticTitleDisplays()) that makes sure that this functionality happens.
So, that basically means that I need convincing that this is something I need to change.
Comment #6
tech108 CreditAttribution: tech108 commentedIt looks like bug fix #399438 might have made it so static titles with no URL display the static title. If there is no URL, nothing should display.
Please advise how to have a static title and not display if no URL is given.
Thank you.
Comment #7
tech108 CreditAttribution: tech108 commentedI reverted to link-6.x-2.9 and now the empty link fields no longer display the static title.
That is my preference.
Comment #8
rootworkThis is clearly a bug -- prior to the 2.10 update, link fields with no URLs were not displaying, as they shouldn't be. The 2.10 changed the functionality, such that link fields that had a static title set would display even if there was no URL.
If this (new) functionality is actually desired, there should be some way to turn it off -- it caused thousands of pages across my site to have the static titles displayed even when there was nothing there. Downgrading to 2.9 until this is addressed.
Let me know if I can help testing or reviewing patches, or providing any additional information on this bug.
Comment #9
rootworkI know development for D6 isn't a priority, but at the very least it'd be nice to see a 2.11 release that fixes this regression.
Comment #10
webservant316 CreditAttribution: webservant316 commentedsame here
Comment #11
flaviovs CreditAttribution: flaviovs commented+1 for a fix for this
Bumping it to major as it breaks expected behavior.
Comment #12
webservant316 CreditAttribution: webservant316 commentedthanks - I am eager to get this fix installed
Comment #13
Jonah Fenn CreditAttribution: Jonah Fenn commentedHi there! We recently updated the Link module here at Oregon State University and are seeing this behavior as well. Based on comment #6, it appears this was done purposely.
Is there a particular case that can be provided as an example regarding why someone would want to see a plain text static title for a non-existent link? This actually seems more like a bug.
Comment #14
dman CreditAttribution: dman commentedThis is an annoying regression. At least make this changed behavior optional, it screwed up our exiting site a bit, and goes against normal Drupal field display expectations.
If there is no data, the field should not display anything.
Reverting to 6.x-2.9 for now.
Comment #15
webservant316 CreditAttribution: webservant316 commentedany progress here?
Comment #16
dstupakewicz CreditAttribution: dstupakewicz commentedI too am experiencing problems with this. When the URL field is left blank, a default title should not be displayed. This is causing the end-user to believe a link is present but is not working. "Dead links" make all site designers look very bad. Please address.
Comment #17
Last Call Media CreditAttribution: Last Call Media commentedHere is the dev version with the patch from comment 1 applied. This patched version has been running several sites without issue for a couple years. It doesn't seem that a new official release of this module will happen.
Comment #18
jenlamptonThe patch in #1 is working for me as well.
Seeing that this is a bug that was introduced in the latest version of the module, I agree that it should be fixed. As per #1.
If the intent in the other issue was to allow people to the ability to show a title when no link is entered (which, is a bit weird, we are talking about link fields here) then there should have been an additional setting introduced that allowed people to choose to "Show static title when link field is left empty" instead of breaking the existing behavior for everyone else :)
Comment #19
rootworkAt long last would someone please commit this fix. The module has been broken for a year and a half, and we have a straightforward fix ready to go.
Please fix this regression with a new version, or at least a new dev.
Comment #20
jcfiala CreditAttribution: jcfiala commentedAh! "Reviewed & tested by the community" are the magic words.
Let me see if I can do something this weekend.
Comment #21
jcfiala CreditAttribution: jcfiala commentedFix has been committed to git, and pushed up, so the dev version of the module should have this soon.
Probably try posting a new version of link in a few days - please test the dev version of the module and see if there's any problems.
Comment #22
rootworkGreat, thanks! Will test.