Needs review
Project:
Activity Log
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2012 at 00:29 UTC
Updated:
11 Jun 2012 at 07:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
jessehsI'm not too familiar with this module. Perhaps there are other places this variable could be used?
Comment #2
jessehsI was thinking about this, and it seems like querying imagecache (and all modules who hook in at that point) could potentially be a performance hit. Here's a reworked patch that stores the default imagecache preset in a static variable, so that once it's calculated, it stays calculated for that particular bootstrap.
Comment #3
jessehsEmpty, not empty, it doesn't really matter does it?
;-)
Comment #4
icecreamyou commentedThanks for the patches.
"Premature optimization is the root of all evil." Donald Knuth :-)
This code is basically what you have a problem with, right? My preferred solution here would be to just use
variable_get('user_picture_imagecache_profiles_default', '')as the imagecache preset instead of adding yet another setting for it.Comment #5
jessehsHehe, that's fine by me. I just wasn't sure if there was any problem with passing in an empty imagecache preset up until someone picks a default.
Comment #6
jessehsHere's what you suggested in #4.
Edit: er... I guess I misread your post. This is not what you suggested, although it does get rid of the static caching.
I see your point about using the profile picture default. That seems like an ideal solution.
Comment #7
icecreamyou commentedHeh. So here is the patch that does what I suggested. However I think that this doesn't actually do anything because technically if Imagecache Profiles is installed it should take over theme('user_picture') and render the correctly sized user picture anyway, right?