'replace_empty' is not a supported key.

Created on 22 June 2024, 5 months ago
Updated 12 July 2024, 4 months ago

Problem/Motivation

I am not certain if this error is for either the Token, or Token Filter modules,

Upon trying to edit and save a Text Format which has the option "Replaces global and entity tokens with their values" selected, I get the following error message:

'replace_empty' is not a supported key.

This is happening on multiple websites. Deselecting the option "Replaces global and entity tokens with their values" does not matter, and the same error is returned. With that option enabled, which is how it has been, deselecting the "Replace empty values" flag does not matter either, and the error persist.

Steps to reproduce

Token and Token Filter are installed, and the "Replaces global and entity tokens with their values" and "Replace empty values" flags have been selected for some time. In the course of building the website, I needed to add some unrelated CKEditor functionality, and began to get this error. So I cannot change any Text Format that has had these options selected. Other Text Formats may be edited without error.

Updating the site to 10.3 and the latest additional modules via composer has not helped. The sites are using Token 8.x-1.14 and Token Filter 2.2.0.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States wmfinck

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

Merge Requests

Comments & Activities

  • Issue created by @wmfinck
  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    That sounds like config validation might be the cause. I'm not 100% sure how that works with text filters, the setting is mentioned in the Annotation of the text filter plugin but maybe it needs to be in the schema file too?

    If it's blocking changes then I reckon this is Major.

  • πŸ‡¦πŸ‡ΉAustria FloGe

    I got the same error. Adding the key to the schema.yaml fixed it for me.

  • Status changed to Needs review 5 months ago
  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    Fantastic, thanks @FloGe.

    Code looks good to me, just want another report of manual testing and I'll push it out.

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

    This morning I added the lines from the patch in #3, cleared the cache, and it worked on both of the affected websites.

    Thank you very much, especially for the quick solution!

  • Assigned to darvanen
  • Status changed to RTBC 5 months ago
  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    I'll call that RTBC then, just gonna turn this into an MR so we can run the pipeline.

  • Merge request !18add 'replace_empty' to config schema β†’ (Merged) created by darvanen
  • Pipeline finished with Skipped
    5 months ago
    #206311
    • darvanen β†’ committed f48d00bb on 2.x
      Issue #3456459 by darvanen, FloGe, wmfinck: 'replace_empty' is not a...
  • Status changed to Fixed 5 months ago
  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    Fixed on 2.x, also cherry-picked to new 2.1.x but that isn't showing up here because it's not a development release yet. Release to follow.

  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    Thanks very much to both of you, hopefully this won't be too disruptive for others now.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thank you very much @darvanen. For when is a release planned? We've also encountered this with the latest "stable" release now.

  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    @Anybody the one I pushed out two days ago? That includes this fix, or so I thought. Can I check which version you're running and whether it has the additional schema in it?

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @darvanen thank you! I'll check that! I just compared the dates and the fix here was from June 24 while the release page says: "2.2.1 released 23 June 2024"

    I'll check that now!

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @darvanen sorry all good! I was confused by the date! The remaining issues are now from other modules. I'll reference this issue there for the appropriate fix! :)

    Great work!

  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    Brilliant, glad to hear it, thanks for following up.

    I think what happened there is the module page doesn't get translated to local timezones the way comments do.

  • πŸ‡ͺπŸ‡ΈSpain taote

    I don't know why the patch is not working for me. Patch applied, cache emptied and same error.

  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    @taote which version are you working with? This has already been released two weeks ago.

    If it's still happening can you open a new issue with the exact problem and how to reproduce it on a fresh site install with just the relevant modules (token and token_filter) in play?

  • πŸ‡ͺπŸ‡ΈSpain taote

    Fixed darvanen.

    I don't know why the modules that I have installed via composer inside a folder called contrib in modules, they were duplicated inside another folder called custom. So I think Drupal was using the wrong module version.

  • Issue was unassigned.
  • Status changed to Fixed 4 months ago
  • πŸ‡¦πŸ‡ΊAustralia darvanen Sydney, Australia

    Composer puts contrib modules there if your composer.json file contains this, which most standard projects do:

    Perhaps someone copied them into custom in order to alter them and forgot to remove them from composer? Glad it's been sorted for you.

Production build 0.71.5 2024