-
Notifications
You must be signed in to change notification settings - Fork 40
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
File upload - Form type for 'content' property instead of entire document #136
Comments
for creation, we will need a form type that reflects File. that said, in
terms of the forms architecture, i think your idea makes a lot of sense.
we should reflect that Resource is a child of File and also separate the
form types and use the ResourceFormType in the FileFormType.
|
OK, so I'll try to implement this ResourceFormType, calling it 'cmf_media_resource', as a child of 'file' form type. |
i am afraid the people who originally contributed this bundle are not
very active anymore. so i can't tell you exactly. try to see what makes
sense. don't hesitate to do a WIP pull request that just shows the idea
and has failing tests or incomplete code in it (put WIP into the title
so its obvious) and we can discuss how it can be done.
also, i am no super-duper form expert, just not to get your expectations
too high...
|
I think I was wrong about mapping File document properties to a form. So I reverted back to the idea of creating a cmf_media_file form type linked to the entire File document and submitted a PR: #137 |
see #137 |
I noticed that MediaBundle defines only a form type for image documents (called 'cmf_media_image'), and doesn't have any basic type for generic binary files (like for example a 'cmf_media_file', or a 'cmf_media_binary'). This was discussed also in #99.
Regarding the definition of this new form type for generic file documents, I was wondering if it would make sense to link it to the 'content' property of the ODM Document, rather than to the entire document itself. I.e. instead of using '...MediaBundle\Doctrine\Phpcr\File' as data_class, use 'Doctrine\ODM\PHPCR\Document\Resource'.
This because a document class extending Phpcr\File could have other properties mapped to different form fields, such as author, description and dates, some of which can be required, and other no, and we want to control them individually, while the file upload part should only be relevant to the binary data.
What do you think about?
The text was updated successfully, but these errors were encountered: