Links not translated when using aliases

Created on 21 August 2024, 3 months ago
Updated 22 August 2024, 3 months ago

Problem/Motivation

When adding a links to alerts on a site using aliases the alert displays with the raw node URL (see: Bootstrap bug - 1 - Alert - notice link hover.png) instead of the canonical alias resulting in a redirect when clicked.

Steps to reproduce

  1. Create an active alert
  2. Select link text and click on the CKEditor link tool
  3. Paste in a relative URL or search for a page (see: Bootstrap bug - 2 - CKEditor link tool - search.png)
  4. Click the green check button to create the hyperlink
    URL will be converted to a raw node URL (see: Bootstrap bug - 3 - CKEditor link tool - link hover.png and Bootstrap bug - 4 - CKEditor link tool - source code.png)
  5. Save the alert

Proposed resolution

Update alert rendering to translate to canonical aliased URLs

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DanLyons

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

Comments & Activities

  • Issue created by @DanLyons
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    danlyons , the drupal alias system allows creating a translation, I suggest using the non-aliased link which when clicked the url will become that alias.

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Appears that you're using linkit

    linkit is likely behaving correctly.

    Next step is to go into the drupal aliases and add an alias for the expected language for this node id, in your case node/17026

    This appears at first glance to be outside of scope of the bootstrap_site_alert module.

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DanLyons

    The URL translation works as expected for other content types:


    It's only within alerts that links render with the raw node URL.

    • We are using Linkit along with Pathauto so the aliases are created automatically
    • We only support a single language
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    check the weights of your test filters in your text format for "Basic HTML"

    make sure that the linkit one is running before others.

  • πŸ‡ΊπŸ‡ΈUnited States DanLyons

    Linkit is set as the first filter to run for all of our HTML text formats

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Hmm, ok as a workaround for now, until this issue is resolved, simply code in an anchor manually with a relative path using the desired alias instead of using linkit.

    I haven't looked that closely at the bootstrap_site_alert source code to know what's going on just yet. I took over maintaining this project so I'm not sure if it's using a text formatter plugin of it's own that should run after the linkit text formatter plugin.

    Possibly need to refactor this module to work better with text formatter plugins.

    With that said, do a simple workaround to get you through the day , we'll keep this issue open to have a closer look.

  • Status changed to Active 3 months ago
Production build 0.71.5 2024