-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add media field to custom entity #172
base: master
Are you sure you want to change the base?
Add media field to custom entity #172
Conversation
Resources/config/routing.yml
Outdated
|
||
pim_customentity_media_rest_post: | ||
path: '/rest/customentity_media' | ||
defaults: { _controller: pim_custom_entity.media_rest_controller.class:postAction } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simoncarre here should be the name of the service pim_custom_entity.media_rest_controller
, not the class. I got issue here
Tested on my side and works well, except the comment regarding service name. Thanks a lot @simoncarre for sharing |
Thank you @diglin for your test. |
Hello @simoncarre , Could you please also check what is failing on Travis? |
{ | ||
/** @var \Symfony\Component\HttpFoundation\File\UploadedFile $file */ | ||
$file = $request->files->get('file'); | ||
$violations = $this->validator->validate($file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an example of file validation in the AcmeCustomBundle ?
Hi @simoncarre, thank you so much for your contribution, this PR seems really promising ! |
class MediaRestController | ||
{ | ||
/** | ||
* Validator interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed comment line
protected $validator; | ||
|
||
/** | ||
* Path generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed comment line
@simoncarre: Hey Simon, any updates here? Would be very nice and extremely helpful to have this feature included in this bundle. |
Add JS files to manage media fields on custom entity