-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Short description of the issue
Pageimage::debugInfo always returns the value from the first queried variation, when querying multiple variations.
Expected behavior
It should return the value of the current queried image variation.
Actual behavior
When querying multiple different variations, it return the value from the first one every time.
Optional: Suggestion for a possible fix
In Pageimage.php on line 424, remove if(!$this->pageimageDebugInfo)
, so that always a new instance with the actual variation is created!
Steps to reproduce the issue
- Step 1
Run the following code in a template file:
$image = $page->images->first();
echo "<pre>";
echo $image->getDebugInfo([], 'object')->files->basename ."\n";
echo $image->width(200)->getDebugInfo([], 'object')->files->basename ."\n";
echo $image->width(120)->getDebugInfo([], 'object')->files->basename ."\n";
echo "</pre>";
- Step 2
Manipulate the wire/core/Pageimage.php file with the above suggested fix, and run the template code again.
Setup/Environment
- ProcessWire version: >= 3.0.132