Allow to skip filter processing in preRenderText()

Created on 6 March 2024, about 1 year 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 review

Version

10.3

Component
Filter 

Last updated about 2 hours ago

No maintainer
Created by

🇨🇭Switzerland DamienMo

Live updates comments and jobs are added and updated live.
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 about 1 year 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

  • Status changed to Closed: works as designed 3 months ago
  • 🇳🇿New Zealand quietone

    Reading the comments this is a Support Request and further, it has been answered by @larowlan,

Production build 0.71.5 2024