This repository was archived by the owner on Nov 16, 2021. It is now read-only.
Open
Conversation
The $file->setPermanent() is already call when you use the file in media entity. If you call this function at this point you can't use tokens or filefield_paths to manipulate the image name and folder to be saved.
phenaproxima
suggested changes
May 10, 2017
Collaborator
phenaproxima
left a comment
There was a problem hiding this comment.
Looks useful, but needs a bit of refinement...
| ); | ||
| $file->setPermanent(); | ||
| $file->save(); | ||
| //$file->setPermanent(); |
Collaborator
There was a problem hiding this comment.
I can't merge this with unexplained, commented-out code in there. If this makes it work (and apparently it still passes the tests, so hey, alright!), then we need a comment here explaining why the file is not saved.
Collaborator
|
This looks like a nice win. I think we're going to need a test of it, though. That's going to be fairly involved, since we'll likely have to write a few new Behat step definitions. I can probably open a feature branch and work on this there, if you'd prefer. Because I'd definitely like to get this committed. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The $file->setPermanent() is already call when you use the file in media entity. If you call this function at this point you can't use tokens or filefield_paths to manipulate the image name and folder to be saved.
#357 You can see the problem with filefield_paths