I get this error when I leave an image field empty and it is still rendered.
The source is not svg_image itself as it works fine in an empty project but it appears in conjunction with other modules(needs investigation which).
Proposed sollution:
in svg_image_preprocess_image_style() run the code only if #uri is also provided.

CommentFileSizeAuthor
#2 empty_field_fix-3154892-2.patch661 bytesrrotari

Issue fork svg_image-3154892

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

rrotari created an issue. See original summary.

rrotari’s picture

StatusFileSize
new661 bytes

Proposed solution integration: skip functionality if uri is empty.

TylerMarshall’s picture

Status: Needs work » Reviewed & tested by the community

Hi there,

I can confirm that this is an issue when someone does not have a required image field. Patch above works for me.

falco010’s picture

Had the same problem and the above patch #2 fixed it for me, thanks!

g-brodiei’s picture

Same here, query failed when the node content was generated with devel generate, which is an empty image.
Fixed with patch #2. Thanks!

steinmb’s picture

Version: 8.x-1.14 » 8.x-1.x-dev
Assigned: rrotari » Unassigned
hkirsman’s picture

Rare one but solved the error I had.

lyndasantiago’s picture

Hi, I have applied this patch and when composer install has finished running, I get an error saying

Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-06-25/empty_field_fix-3154892-2...

I would appreciate some help. Thank you so much.

steinmb’s picture

Try running composer with the -vvv option.

zvse made their first commit to this issue’s fork.

  • rrotari authored ecd2d4d on 8.x-1.x
    Issue #3154892 by rrotari: Query condition '%s %s ()' cannot be empty
    
imyaro’s picture

Status: Reviewed & tested by the community » Fixed

Thank you, it was included to the last release (.15)

Status: Fixed » Closed (fixed)

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