Add multiple uploadables feature#1342
Merged
Merged
Conversation
…tityFileInfo instead of storing it under file info as this looks cleaner. Also fixes identifier not passed to filename generator.
Contributor
|
thanks it looks like a great improvement, regarding YML and XML hope people will contribute if they need it, I will merge it with minor version change, since it is worth mentioning about the possible BC if extended. |
l3pp4rd
added a commit
that referenced
this pull request
Mar 8, 2016
Add multiple uploadables feature
Contributor
|
hey @stof that may have effect on the bundle as mentioned. I think I'll stop any changes to API after 3.0.0, so probably these will be the last changes to adapt unless someone starts to maintain extensions apart from myself :) 3.0.0 won't be released soon, few months at least |
This was referenced Sep 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: #961
This changeset adds multiple uploadables support in a single entity.
identifierproperty is added to all annotations in the uploadable familty (@Uploadable@UploadableFileMimeType,@UploadableFileName,@UploadableFilePath, and@UploadableFileSize), with a default value_default. This ensures that no code change is needed in single upload situation.@Uploadablesannotation added to support multiple uploadable behavior.The bad thing is I only added multiple support to annotation (I probably don't have spare time to write and test the yml and xml config, so need external help). The good thing is the original configuration won't break.
However there are cases of potential bc-break:
identifieris also added toFilenameGeneratorInterface::generate()as the forth argument. Currently this is used by theFilenameGeneratorSha1class to prevent having the same SHA1 result when the same filename and extension are passed to different file fields (with different identifiers) in the same entity. This may affect users who implements their ownFilenameGeneratorInterface.processFile()andmoveFile()inUploadableListenerchanged frompublictoprotectedbecause their signature are changed and they don't look right to be public. This may affect users who override the originalUploadableListener.Finally, not related to this project, but still worth mentioning is that a change to stof's DoctrineExtensionsBundle is also needed to support multiple uploadables in a single entity. Modify the
markEntityToUpload()method of\Stof\DoctrineExtensionsBundle\Uploadable\UploadableManageras below:Usage of this method will become: