monsieurbiz / SyliusRichEditorPlugin

This plugin add a rich editor on fields to be able to drag and drop elements and edit it.
MIT License
65 stars 36 forks source link

Allow creation of image / image_collection in fixture without link attribute #157

Closed MatteoL-W closed 2 years ago

MatteoL-W commented 2 years ago

The original files did not allow adding an image / image_collection in fixtures without adding the "link" attribute

jacquesbh commented 2 years ago

Actually if your JSON doesn't contain the link then it's incomplete.

You must have the link value, but empty.

What do you think?

MatteoL-W commented 2 years ago

Yes that's true ! I took a little time to find out what was wrong, this is why I thought that this minor update could help ! (since the image fixture are not documented and symfony's error messages are not really effective in that case)

maximehuran commented 2 years ago

What is your Symfony's error message on that case ?

MatteoL-W commented 2 years ago

Mybad, I noticed afterwards that related symfony error messages were available in the ajax requests (and pretty effective).

If I have to explain my reasoning, I would say that I find weird to require a link (even empty) for an image and in that case, mainly if an "alt" is not at least as needy.

But don't make me wrong, I totally agree that this PR is not revolutionary and don't necessary need to be accepted ! :smile: Have a nice day

jacquesbh commented 2 years ago

@MatteoL-W I agree that this PR could improve things.

But I'm not sure it's what we want. In fixtures you can have the "link" empty, it's not that big of a deal.

Will is make your clearer not to have it? I'm not sure actually :). The purpose of fixtures is to change over time, and having the link inside the JSON already makes it easier later to change it. I would prefer to keep it the way it is: we want all attributes to be in the JSON, event empty ones.