Skip to content

SVG Handler - need fallback when file doesn't exist #9481

@bratvanov

Description

@bratvanov

When an element that supports the SVG features added in Elementor 2.6 has a SVG graphic/icon added from the Media Library and later the graphic is deleted from outside Elementor, the below error will show in the place where the icon is supposed to be when PHP warnings are enabled:

<div class="elementor-icon">
<b>Warning</b>: file_get_contents(): Filename cannot be empty in <b>\wp-content\plugins\elementor\core\files\assets\svg\svg-handler.php</b> on line <b>120</b>
</div>

elementor-svg-icon-placeholder-warning

Additionally the left sidebar where a preview of the SVG should show up is broken as well, looks like the HTML for the whole page gets rendered in that box as a result of the PHP warning and there are a whole bunch of other side-effects like broken scripts and fonts in the Elementor editor as a result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates a bug with one or multiple components.status/mergedIndicates when a Pull Request has been merged to a Release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions