Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
24 Feb 2008 at 03:51 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drummComment #2
brendoncrawford commentedCan we get some love on this?
Comment #3
webchickMoving to documentation component, and moving down to D6. I think #238681: theme_image() not evaluating properly? is a better approach for D7.
Comment #4
jhodgdonLooking at the code, it looks like in Drupal 5/6, theme_image() only works if either getsize is FALSE or if the URL is relative to the base path and it can figure out the image dimensions. The original report is wrong, IMO -- it needs to be $getsize=FALSE to work with absolute URLs.
It is also still working the same in Drupal 7. The issue mentioned above has been closed as a "won't fix".
So this needs to be documented in Drupal 7, 6, and 5.
Comment #5
jhodgdonCould be a good novice project.
Comment #6
mgriego commentedI assume this is what you're looking for... My reading of the code was the same that $getsize needs to be false for fully qualified URLs to work, so I added the appropriate parameter comments for D5/6/7.
Comment #8
jhodgdonCan you rework this a bit? (I"m talking about the D7 patch, didn't look at the others yet -- let's get that one right first):
- We don't usually use all-caps -- it's a bit shouty. Just say "This must be set..." rather than "This MUST be set".
- There is no $path in the D7 args - it's a component of the variables array
- We should probably mention on the 'path' component as well that you need to set the 'getsize' component to FALSE if you use a full URL
Also, please read the instructions below the file attach about file names for D6/D5, which will avoid having the test bot complain.
Comment #9
amateescu commentedThis doesn't make sense anymore for D7 because the $getsize component was removed in #908282: Remove unnecessary I/O from theme_image().
Comment #10
jhodgdonThanks for checking into that -- you are correct. So we just need a Drupal 6 patch.
Comment #11
daniels220 commentedHere's my stab at a D6 patch.
Comment #12
jhodgdonMissing a . at the end of the sentence.
false -> FALSE
Also, when you attach a patch, please set the status to "needs review", so that we know there's something to review, thanks!
Comment #13
daniels220 commentedThanks for the feedback. New patch attached.
Comment #14
jhodgdonpatch header needs fixing - wrong file names, can't apply
Comment #15
jhodgdonActually, the text here is not correct. You don't need to set $get_size to FALSE if a URL is used, you need to supply the sizes yourself because $get_size will be ignored... correct?
Comment #16
daniels220 commentedNot sure on the wording for $getsize, but I noted that it is ignored if $path is a full URL.
Comment #17
jhodgdonUgh, my mistake.
I looked closer at the code and I think you do need to set $get_size to FALSE, because if it's set to TRUE and is_file() returns FALSE, nothing will get printed. Yuck! who wrote this code?!?
Comment #18
daniels220 commentedYou are indeed right. New patch attached with slightly more noticeable warnings about needing to set $getsize = false.
Comment #19
jhodgdonHmmm.
- In 2nd sentence, url -> URL.
- I don't think that 2nd sentence is accurate. It looks to me like if $getsize is TRUE, nothing at all is returned (not an empty IMG tag).
Maybe this should mention that TRUE is the default? Also, there should be a blank line between the @param and @return.
Comment #20
daniels220 commentedFixed all that.
Comment #21
jhodgdonNow we're talking. Looks good. Thanks for the repeat patching.
Comment #22
gábor hojtsyGreat, committed, thanks.