Thumb is Always Selected
jjeff - July 23, 2006 - 21:28
| Project: | Image Exact Sizes |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
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
| Attachment | Size |
|---|---|
| not-always-thumb.patch | 1.41 KB |

#1
Jeff, thanks for the patch. I'll review and commit shortly.
#2
Hmmm... Now I'm having a problem where the wrong image is getting "exact size"-ed. Working on it. Should have new patch soon.
-j
#3
Okay... 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