I get an error while comparing two revisions when images changed, image thumbnail of the image field should be showed and no preview image style is set.

Error: Call to a member function transformDimensions() on null in template_preprocess_image_style() (line 288 of core/modules/image/image.module).
The website encountered an unexpected error. Please try again later.

Issue fork diff-2930965

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

neelam.chaudhary created an issue. See original summary.

abhay.agarwal’s picture

Status: Active » Needs review
StatusFileSize
new794 bytes

Fixing the issue as when no preview style is selected for the image field, 'thumbnail' style will be applied by default.
The error will not appear.

johnchque’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Let's test this, please.

silvi.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new789 bytes

Patch updated with latest code changes.

acbramley’s picture

Status: Needs review » Needs work

Still needs tests.

@silvi.addweb please ensure you are fully reading what is required to put these issues into Needs Review before you do. I have spent a lot of time responding to your issues that are in Needs review but are clearly not ready.

Also please make sure to follow the instructions for checking out and pushing branches to gitlab, it looks like you're committing and pushing work on the fork's 8.x-1.x branch.

gilmar.lima’s picture

Hello team, here is a patch to fix the issue with empty preview as well as test update.