Because of the way that Drupal is dealing with variables (perhaps this is a core bug), checkboxes with numeric values need to not have a zero because Drupal gets confused between 0 and not selected. Because image.module uses 0 as the id for the thumbnail size, this checkbox is always selected when you go to the image_exact.module settings page. This patch adds "size-" to the beginning of each key, so that things are stored in the variables table as:
[image_exact_size] => Array
(
[size-3] => size-3
[size-0] => 0
[size-1] => 0
[size-2] => 0
)
instead of:
[image_exact_size] => Array
(
[2] => 2
[3] => 3
[0] => 0
[1] => 0
)
Then when the variable is called back out, the "size-" is removed. Problem solved.
-jeff
Comments
Comment #1
joshk commentedJeff, thanks for the patch. I'll review and commit shortly.
Comment #2
jjeff commentedHmmm... Now I'm having a problem where the wrong image is getting "exact size"-ed. Working on it. Should have new patch soon.
-j
Comment #3
jjeff commentedOkay... This patch seems to be working now. I'm still having a problem, but I'll post it as a separate issue.
Here's a new version of this patch. Also adds a few t() functions that were missing.
-jeff