Allow all preprocess functions to modify the responsive bg image vars.

Created on 29 May 2021, over 3 years ago
Updated 21 October 2024, about 1 month ago

Problem/Motivation

Preprocessing images to make the src absolute linked (or other) has no effect because the responsive bg image formatter calls template_preprocess_responsive_image directly. Better to go through calling each registered preprocess function.

Steps to reproduce

Add a hook_preprocess_responsive_image() callback to your theme or module. Make an image field using the responsive bg image formatter and see that your preprocess code has no effect on render.

Proposed resolution

Instead of calling template_preprocess_responsive_image() directly on line 104 of ResponsiveBgImageFormatter.php loop through all registered preprocessor functions and call them, similar to what theme.inc does on render.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tbenice

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024