Allow to skip filter processing in preRenderText()

Created on 6 March 2024, 3 months ago
Updated 18 March 2024, 3 months ago

Problem/Motivation

Having an input filter that we don't want to execute when a node is rendering in a certain view mode.

Proposed resolution

Add #filters_to_skip property so we can define filters to be skipped in hook_preprocess_field().

✨ Feature request
Status

Needs work

Version

10.3 ✨

Component
FilterΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡¨πŸ‡­Switzerland DamienMo

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @DamienMo
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since we don't have a filter sub-maintainer going to need framework manager sign off if this is a feature they would accept.

    If so then will need test coverage.

  • Status changed to Needs work 3 months ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    I'm not in favour of this change, it could lead to quirky cache bugs.

    The output of filters is cached, and in the current code-path there is no consideration of cache keys based on filters to skip.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Any reason you can't use a different input format in a different formatter which has different filters? Feels like that can be achieved as is.

  • πŸ‡¨πŸ‡­Switzerland DamienMo

    Any reason you can't use a different input format in a different formatter which has different filters? Feels like that can be achieved as is.

    I'm not sure what you mean. I see no way I can change input formatter for different node view modes.

    I'm not familiar with how to add cache tags for the filters to skip can someone help here ?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    So you can create a formatter, and it can return a render array of type processed_text and set a different format.

    That's the idea I'm suggesting

  • πŸ‡¨πŸ‡­Switzerland DamienMo

    When I use the formatter on a node field, the same formatter is used in every node view mode. I can't change input formatter depending on node view modes like you are suggesting.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    If you write a custom formatter you can, that's what I'm proposing

Production build 0.69.0 2024