Skip to content

Twig extension getCurrentFilePath throw exception (solved, need confirmation) #179

Description

@Loocos

Hello there,

I want to know if my solution is the best regarding to your plugin. I've added a second image file type in the ImageType form.
But after that, it throw an error 500 on the form validation if one of the two input image file type is empty/not set.

It come from the RichEditorExtension.php, twig filter function getCurrentFilePath because it's needed to return a string or a null but it's returning an object (UploadedFile)

So my solution is to add a is_object check and return null if true because the file/image isn't uploaded yet and we canno't get the right path :
image

Is it a good solution for you @jacquesbh ?
I can make a PR if that's good for you :)

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions