Closed gonzalovilaseca closed 8 years ago
hm, that is strange. we do wipe the stream from the property during the save operation: https://github.com/jackalope/jackalope/blob/master/src/Jackalope/Property.php#L269-L271 unfortunately i don't remember why exactly (that code is 4 years old, after all) but i think it had to do with memory consumption and with normalizing how streams look.
but the getBinary method is supposed to reload it immediately. https://github.com/jackalope/jackalope/blob/master/src/Jackalope/Property.php#L308-L312
could this be a bug when wrapBinaryStreams is true? indeed there are some illogic things in that method, as the value is unconditionally set to null.
do you have time to investigate into this? we should create some unit tests for the different flags i think, to check which cases work and which dont. and then fix the cases that don't work.
hm, just realized that your code is mapped on a document, so it would also be something with what the unit of work does during the save - the mystery deepens. but can you try playing with the Property class to re-load the stream even if the streamwrapper is not enabled, or not set the value to null, just to see on which layer the issue is?
Ok, I will investigate and report back as soon as I find something.
@gonzalovilaseca did you happen to find anything here?
Sorry, I didn't.
i will close this for now. if you find a way to reproduce it (ideally with a phpunit test in this bundle) please re-open or do a pull request with the failing test.
Not sure if this is a MediaBundle issue or a Doctrine problem. in this case:
$stream
is null, previous to the flushgetFileContentAsStream
returns a stream.OTOH with this code:
$stream
is a valid stream.Any ideas?