Lakion / CmsPlugin

Simple CMS on top of SymfonyCMF for Sylius applications.
http://lakion.com
26 stars 20 forks source link

replace FileType with ImageType for images #65

Open kochen opened 6 years ago

kochen commented 6 years ago

fixes #31 replaces #63

michalmarcinkowski commented 6 years ago

Thanks @kochen! Could you have a look at the failing build?

kochen commented 6 years ago

Could not find a defined element with name "block". The defined ones are: cmf-block.

@michalmarcinkowski could it be that:

$this->getElement('block')

needs to actually be:

$this->getElement('cmf-block')

and it has nothing to do with my fix?

kochen commented 6 years ago

@michalmarcinkowski the fix I proposed, solves issue #31, allowing existing blocks which already contain image to be edited and image to be added/replaced.

But, when a new (i.e custom) block is created with a new image, there is an error: The node '/cms/media' already has a child named 'image''. which is eventually what causes the test to fail.

Any idea how to solve this one?

michalmarcinkowski commented 6 years ago

How is it possible that the tests pass on master branch, but not on yours? Have you tried to debug which of your change cased the error?

kochen commented 6 years ago

@michalmarcinkowski because I replaced FileType with ImageType for images and it seem to behave differently.

kochen commented 6 years ago

@michalmarcinkowski simply because there are no test for "editing a block with image" :/

michalmarcinkowski commented 6 years ago

That's bad... @kochen are you able to fix the issue?

kochen commented 6 years ago

@michalmarcinkowski not from the little time I invested in it. The problem seems to be much deeper than this plugin and CmfMediaBundle is abandoned anyway so you should consider some alternatives for the future anyway...

michalmarcinkowski commented 6 years ago

Thanks for the feedback, if you will have any more information that could help, please share it with us 😉

kochen commented 6 years ago

@michalmarcinkowski first thing I'm trying to do is write some tests which will show the problem. Any help you could provide here (specially on the factory/image)?

kochen commented 6 years ago

@michalmarcinkowski the problem is somewhere in the actual generation of the image: image

instead of belonging to the actual content-block parent, it is independent and therefor a second block with an image will try to save another /cms/media/image which already exists...