Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roopeshnaik created an issue. See original summary.

reshma.i’s picture

There might be a requirement like if you want to display default static title, But still yes! This is a issue. Uploaded patch is working for me.

Trav84’s picture

Rerolled against dev. Added token replacement on title.

michaelfavia’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Assigned: Unassigned » michaelfavia
Status: Active » Reviewed & tested by the community

Tested and confirmed proper operation on 7.x. Any chance we could get this in for future versions of link module? Happy to revise patch or approach as needed with feedback. Thanks!

The last submitted patch, 2: optional_url_static_title_notworking-2553705.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: optional_url_static_title_with_tokens-2553705.patch, failed testing.

Trav84’s picture

Removed function call from empty to support PHP versions prior to 5.5.

michaelfavia’s picture

Reviewed patch. Syntax error fixed. php 5.3 compat now. RTBC

Trav84’s picture

aguilarm’s picture

Status: Needs work » Needs review
FileSize
1.24 KB

Bit of adjusting, token_replace is escaping special chars and as a result this was rendering out & and things which is not intended. Ideally this should be in _link_sanitize probably.

Status: Needs review » Needs work

The last submitted patch, 10: link_optional_static_title_token_2553705_10.patch, failed testing.

aguilarm’s picture

Status: Needs work » Needs review
FileSize
1.53 KB

Adjusting the patch format

renatog’s picture

Assigned: michaelfavia » renatog
Status: Needs review » Reviewed & tested by the community
Issue tags: +ciandt-contrib
FileSize
43.66 KB
18.07 KB

Hi people.

I applied the patch and work good for me.

+RTBC

  • RenatoG committed cb96589 on 7.x-1.x authored by reshma.i
    Issue #2553705 by Trav84, aguilarm, michaelfavia, reshma.i, RenatoG,...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Fixed.

Commited in dev branch.

Thank you all for contributions.

Good Work and Good Weekend.

Regards.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Bès’s picture

The static title is displayed even when the 'Optional URL' is not checked, this is a regression.
Can you please reopen the issue ?

Haza’s picture

I know this is not a funny thing to do, but please, when you apply patches, please reroll them and post the patch here, then apply the same patch as the one posted here.

Applied patch is not the same as the one we have here : http://cgit.drupalcode.org/link/patch/?id=cb96589532d581cce6852eb06a3712...

vinmassaro’s picture

pifagor’s picture

pifagor’s picture

Hello everyone
@vinmassaro, @Bès
The patch is working. We have to show the link title, even if there is no URL (if you have active option "Optional URL").
This is similar to the behavior of the link display when we have the "Optional URL" and "Optional Title" or "Required Title" or empty URL.
For example. In the version of the module 7.x-1.4, if we have the "Optional URL" and "Optional Title" active parameters and the empty URL, the header of the link is displayed.
The link should not be displayed when the active parameter is "No Title" and the empty field URL while saving the node.
I think we can close this issue.

pifagor’s picture

Assigned: renatog » Unassigned
Status: Needs work » Reviewed & tested by the community
pifagor’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
vinmassaro’s picture

@pifagor: thanks for reviewing. We have hundreds of sites using this module and when deploying out 7.x-1.5-beta3, behavior that was not expected started happening. There is a link field with a static title set. On a node where this field was empty, the field was not output, as expected. After updating to 7.x-1.5-beta3, the node began showing the static title as plain text, not linked to anything, because the field was empty. This doesn't seem to make sense to me. Why would I want the static title to appear as plain text when the actual link field is empty and there is nothing to link the static title to?

This patch seems to reverse default expected behavior of the Link module that has already been established for a long time (if the field is empty, don't display anything).

pifagor’s picture

@vinmassaro
Try adding "Optional URL" and "Optional Title"
And at the same time save the link value without the URL. The link name will be available without the link itself.
This works the module independing on the version.

PS:
If this creates problems, we may remove this patch from version 1.5.
However, in version 1.6, we must include either the current behavior or not display the link at all if there is no URL.

pifagor’s picture

Status: Postponed (maintainer needs more info) » Needs review
vinmassaro’s picture

@pifagor: Thanks for the quick reply again. What is the use case of having an optional title with no link? Why would you want a plain text title to be output without being linked to something?

The issue here for us is that this changes the behavior of existing link fields. If you create a new link field and configure it just so, the title will not print out. But for an existing field with a static title that is empty, the update begins outputting the static title as plain text which is not the desired behavior. I imagine you will get new issues added to the issue queue if this becomes part of the release, since it can be seen as a bug for users updating the Link module. It would require manual reconfiguration of existing link fields in order to replicate the old behavior. This for us is not possible given we manage nearly ~1000 sites that use link fields all over the place.

pifagor’s picture

Version: 7.x-1.x-dev » 7.x-1.5-beta3
Priority: Normal » Critical
FileSize
1.24 KB

Hi @vinmassaro
Yes, of course, this is a problem.
I am adding the patch returns compatibility for version 7.x-1.5-beta3 and the problem will disappear.
In the following version, we will redesign this functionality.

@vinmassaro, please test the patch

vinmassaro’s picture

@pifagor thanks, will get back to you on this patch.

vinmassaro’s picture

@pifagor: Thank you, the patch seems to be working. I don't see the same unexpected behavior happen with the link fields when updating to 7.x-1.5-beta3 and applying the patch, but I also did not test the changes added by this patch.

pifagor’s picture

pifagor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.