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
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

TitaCvetkovic created an issue. See original summary.

hebl’s picture

Status: Active » Postponed (maintainer needs more info)

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?

titacvetkovic’s picture

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 is even initiated.

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

joco_sp’s picture

Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Active

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.

joco_sp’s picture

Status: Active » Needs review

Hopefully I put the changes in the correct branches.

b_sharpe’s picture

Status: Needs review » Needs work

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.
    
b_sharpe’s picture

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