Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
image system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2010 at 16:35 UTC
Updated:
31 Aug 2010 at 16:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
chx commentedSo when i have converted the file system to a flexible one, well, THIS one wanted the original file_uri_target...
Comment #2
chx commentedHere is a more understandable example of what happens. If you have something like flickr://chx/4781325384/ which would serve the picture at http://www.flickr.com/photos/chx/4781325384/ then image style generate would create a URL like image/generate/large/flickr/www.flickr.com/photos/chx/4781325384/ instead of image/generate/large/flickr/chx/4781325384. And the flickr stream wrapper would get flickr://www.flickr.com/photos/chx/4781325384 and it would not know what the heck is on.
Comment #3
chx commentedHm, sorry, this does not break core.
Comment #4
chx commentedBut we have a shiny new major priority. Good!
Comment #5
drewish commentedsubscribe
Comment #6
damien tournoud commentedI am *very* confused as of what file_uri_target() is actually supposed to do (transform an URI... into what?)...
Comment #7
damien tournoud commentedSo it seems that file_uri_target() is actually just designed to return the part of the URI after the '://' (while keeping it URL-encoded). As a consequence, the current implementation looks correct.
But file_uri_target() feels completely foobar right now. I guess we need something like this.
Comment #9
chx commentedDamien, this is a gem. In an issue about something being unclear you said:
:D
Your patch would revert what I did with file_uri_target. You can be right. Returning a locally writeable file path indeed more belongs to the local class than the generic interface. However we can not remove getTarget from there because if you want to extend that (nee hash_target) you simply can't.
Comment #10
andypostI think flickr is not a good example because this kind of field should have own formatter and does not correlate with image field at all
Comment #11
aaron commentedsubscribe. and don't forget that image != imagefield, and with stream wrappers there's no technical reason that image couldn't work on remote images.
Comment #12
chx commentedIt seems drewish, Damien and I are all agreed on this patch.
Comment #13
chx commentedeh i moved too much. there is already a getTarget in local.
Comment #14
drewish commentedThis seems like the sanest way out of the mess we've made.
Comment #15
damien tournoud commentedThis looks very good to me. It's probably not the only modification we need to make to the stream wrappers, but it's a good first step.
Comment #17
aaron commentedi was going to test out an example or two, but remembered that, unfortunately, the stream wrapper implementation is still a bit broken, as we can't file_copy from an external stream, because file_exists returns FALSE for streams (which is called against the source uri in file_unmanaged_copy). thus, we have to use a raw copy() as in http://drupalcode.org/viewvc/drupal/contributions/modules/media/media.mo....
thus, i have no real way of knowing if this approach is sound or not, as the only place where it's going to even matter is for local file systems. boo.
Comment #18
aaron commentedsetting status back.
Comment #19
rfaysubscribe
Comment #20
damien tournoud commentedComment #21
chx commentedGiven drewish's comment I think we are good to go. (Damien's patch does not change the approach, i ran an interdiff, it just fixes a braino.)
Comment #22
dries commentedI believe pwolanin wrote a lot of this code so I'd like him to give it a thumbs up.
Comment #23
pwolanin commentedLooks like this is reverting basically back to what we had earlier, so it seems fine to me.
One comment - why use substr() when elsewhere we do this:
We should be consistent, so CNW to make this code match more like:
Comment #24
damien tournoud commentedRerolled, your honor.
Comment #25
damien tournoud commentedMatching the logic.
Comment #26
pwolanin commented[edit] new patch fixes the problem
Comment #27
pwolanin commentedThe logic in question is returning FALSE on failure, as the function did before.
This looks ok to me now.
Comment #28
dries commentedCommitted to CVS HEAD. Thanks.