Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create custom entity with image field? #88

Open
kevinrademan opened this issue Jun 14, 2017 · 5 comments
Open

How to create custom entity with image field? #88

kevinrademan opened this issue Jun 14, 2017 · 5 comments

Comments

@kevinrademan
Copy link
Contributor

kevinrademan commented Jun 14, 2017

Hi Guys

I'm currently trying to get a custom entity working with a image fields. I've manage to get the system to render the media control by changing my form type to include the following

->add('logo', 'pim_enrich_media')

When I try and save, it gives me the following error

An exception occurred while executing 'UPDATE acme_reference_data_retailer SET logo = ? WHERE id = ?' with params [{}, 1]:

Catchable Fatal Error: Method Akeneo\Component\FileStorage\Model\FileInfo::__toString() must return a string value

I'm assuming that there is some middle ware layer that is supposed to save the image to the file system and replace the value from post with the file path. I just haven't been able to figure out how that all fits together.

@fitn
Copy link
Contributor

fitn commented Aug 9, 2017

Hi @kevinrademan

Yes, many people raised us this problem. Unfortunately, we don't have enough time to work on it so if you find any tip, feel free to share it with our community.

Regards,

@jmleroux
Copy link
Contributor

Any news on this subject?

@simoncarre
Copy link

I added this feature on one of my projects. I will do a PR soon.

capture_001

@sylvainraye
Copy link

@simoncarre could you maybe share your code without PR, I need it right now. Thank you in advance

@jotalops
Copy link

@simoncarre could you maybe share your code ?. in which version of akeneo works? when saving the custom entity the two entities asset - and yours are linked??
Lot of Thanks in advance :)

@jmleroux jmleroux reopened this Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants