Problem/Motivation

The BackgroundImageResize::alterPath() method produces recursively nested image style paths in background-image CSS URLs, resulting in broken URLs like:

Steps to reproduce

  1. Enable pagedesigner_responsive_images with enable_responsive_background_images set to TRUE
  2. Add a pagedesigner component with a background image
  3. Save and publish the page
  4. Edit the page again in pagedesigner and save
  5. Repeat step 4 — each save adds another styles/XXX/public/ nesting layer to the background-image URL

Proposed resolution

Strip any existing styles/XXX/public/ segments before inserting the new one, making the method idempotent.

An update hook should also be added to clean corrupted data already stored in the database.

Remaining tasks

User interface changes

API changes

Data model changes

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

guillaumepacilly created an issue. See original summary.

guillaumepacilly’s picture

Status: Active » Needs review
guillaumepacilly’s picture

Status: Needs review » Reviewed & tested by the community

guillaumepacilly’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

guillaumepacilly’s picture

Status: Fixed » Closed (fixed)