Chopped email displayed to authenticated and anonymous users

Created on 9 November 2023, about 1 year ago
Updated 7 August 2024, 4 months ago

Problem/Motivation

The Obfuscate Email process worked smoothly until yesterday. Now suddenly the data-mail-to="vasb/ng/grfg/qbg/pbz" data-replace-inner attributes are present in the front end. These elements do not get converted to href="mailto:info@test.com" as before.

Steps to reproduce

  • Run composer require 'drupal/obfuscate_email:^2.1'
  • Enable obfuscate_email filter for the Full HTML text format
  • Add info@test.com to content in CKEditor
🐛 Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

🇹🇷Turkey titacvetkovic

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

Merge Requests

Comments & Activities

  • Issue created by @titacvetkovic
  • Status changed to Postponed: needs info about 1 year ago
  • 🇬🇧United Kingdom hebl

    Hello,

    I've installed and tested this and it's working as expected my end.

    Have you checked your JavaScript console to check if any other errors are blocking the execution of this module code?

  • 🇹🇷Turkey titacvetkovic

    Hi @Hebl,

    Thank you for testing this from your end.

    Well, that's the odd thing - I don't get any errors anywhere. All of this is clear:
    - /admin/reports/dblog
    - /admin/reports/status
    - PhpStorm "Problems" tab
    - Firefox Developer console
    - Chrome console

    But the emails are chopped locally and on the server. It looks like the issue starts before JS even starts working on it.

    For now we just had to disable the module on the live site in order for the emails to look professional.

  • Status changed to Active 10 months ago
  • 🇸🇮Slovenia joco_sp

    The issue is still present. We have it on multiple websites. Core Drupal 10.2.2 and the module version 2.1.0. It's happening only for the anonymous users and on the production websites.

    I managed to pintpoint the cause to the core aggregation of the JavaScript files.

    Two solutions worked for me. Either attach the library to the head

    default:
      version: VERSION
      header: true # Added
      js:
        js/obfuscate_email.js: {}
      dependencies:
        - core/drupal
    

    or do not preprocess it

    default:
      version: VERSION
      js:
        js/obfuscate_email.js: {preprocess: false} # Added
      dependencies:
        - core/drupal

    I prefer the option to put it in the head.

  • Status changed to Needs review 10 months ago
  • 🇸🇮Slovenia joco_sp

    Hopefully I put the changes in the correct branches.

  • Status changed to Needs work 9 months ago
  • 🇨🇦Canada b_sharpe

    I just ran a fresh D10.2 and can't reproduce this, are you using the email field or the Text Filter (CKEdtior)?

    • b_sharpe committed 92cbf0ee on 2.1.x
      Issue #3400440: Remove VERSION constraint to allow hashed aggregation.
      
  • 🇨🇦Canada b_sharpe

    Potentially related, I've removed the VERSION constraint from the library due to #2205027: VERSION in library declarations does not work for contributed/custom modules

Production build 0.71.5 2024