Skip to content

Add media field to custom entity#172

Open
simoncarre wants to merge 2 commits intoFriendsOfAkeneo:masterfrom
ClickAndMortar:feature-add-media-on-custom-entity
Open

Add media field to custom entity#172
simoncarre wants to merge 2 commits intoFriendsOfAkeneo:masterfrom
ClickAndMortar:feature-add-media-on-custom-entity

Conversation

@simoncarre
Copy link
Copy Markdown

Add JS files to manage media fields on custom entity


pim_customentity_media_rest_post:
path: '/rest/customentity_media'
defaults: { _controller: pim_custom_entity.media_rest_controller.class:postAction }
Copy link
Copy Markdown

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

@sylvainraye
Copy link
Copy Markdown

Tested on my side and works well, except the comment regarding service name. Thanks a lot @simoncarre for sharing

@simoncarre
Copy link
Copy Markdown
Author

Thank you @diglin for your test.
Fixed!

@jmleroux
Copy link
Copy Markdown
Contributor

Hello @simoncarre ,
I asked review to some of my teammates.

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);
Copy link
Copy Markdown
Collaborator

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 ?

@mmetayer
Copy link
Copy Markdown
Collaborator

mmetayer commented Mar 29, 2018

Hi @simoncarre, thank you so much for your contribution, this PR seems really promising !
Before I can review it, though, could you rebase against the master branch?
Also, there are 2 tests failing (in docs/examples/CustomBundle/spec/Normalizer/Standard/BrandNormalizerSpec.php and Tests/Jobs/Export/CustomEntityExportTest.php), could you please fix them?

class MediaRestController
{
/**
* Validator interface
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed comment line

@dimitri-koenig
Copy link
Copy Markdown

@simoncarre: Hey Simon, any updates here? Would be very nice and extremely helpful to have this feature included in this bundle.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants