Link Label in Field Formatter is not working

Created on 26 June 2023, over 1 year ago
Updated 22 September 2023, over 1 year ago

Problem/Motivation

The Link Label field formatter option does not have any effect when set.

Steps to reproduce

Manage the display for a content type, add an email field and set the formatter to "Obfuscate", and enter a Link label. The email address is still displayed rather than the Link label. eg. <a href="mailto:obsfxyz">test@mail.com</a> rather than <a href="mailto:obsfxyz">My Label</a>

Proposed resolution

The linkLabel is being passed to the getObfuscatedLink function via the wrong parameter. I will submit a patch to fix this.

🐛 Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

🇺🇸United States cindytwilliams Nashville, TN

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cindytwilliams
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States cindytwilliams Nashville, TN

    Here is a patch that passes the $linkLabel to the getObfuscatedLink function via the correct parameter.

  • 🇮🇳India supriya1992

    This patch is working absolutely fine. I tested it by following the steps.

    1. Created a field-type email in a content type.
    2. Changed the email field display format to Obfuscate and add the link label in configuration.
    3. Add content in this field.
    4. Before applying the patch, the email will display in the node content.
    5. After applying the patch, the email is replaced with the provided link label.

    Attaching the screenshots.

  • 🇮🇳India Anjali Mehta

    I have tested the patch. The patch has been implemented successfully.
    I am attaching screenshot for your reference.
    Thank You.

  • Status changed to RTBC over 1 year ago
  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts

    Hiding screenshots from the main issue as they are in comments, and hiding the actual patch.

    Patch solves the issue, marking as RTBC. Thanks!

Production build 0.71.5 2024