Problem/Motivation

\Drupal\crop\Entity\Crop::getEffectsFromImageStyleId uses a static property to try and avoid loading image styles over and over. However it is not having this effect when the loaded image style is null.

It's a quirk with XB and it's dynamic xb_parametrized_width image style. The image style ID comes over as xb_parametrized_width--{width}

Steps to reproduce

xdebug the method, see it called over and over for the same image style

Proposed resolution

Set the static cache if image style is null

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork crop-3540060

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

mglaman created an issue. See original summary.

mglaman’s picture

Title: \Drupal\crop\Entity\Crop::$effectsByImageStyle is not providing any performance benefits » \Drupal\crop\Entity\Crop::$effectsByImageStyle doesn't statically cache null results
Issue summary: View changes

mglaman’s picture

Assigned: mglaman » Unassigned
Status: Active » Needs review
phenaproxima’s picture

Status: Needs review » Fixed

This makes a ton of sense. Merge train started to 8.x-2.x, thanks!

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.

  • phenaproxima committed ceabd146 on 8.x-2.x authored by mglaman
    fix: #3540060 \Drupal\crop\Entity\Crop::$effectsByImageStyle doesn't...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.