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

AttachmentSize
not-always-thumb.patch1.41 KB

#1

joshk - July 23, 2006 - 21:52

Jeff, thanks for the patch. I'll review and commit shortly.

#2

jjeff - July 24, 2006 - 00:21

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

jjeff - July 24, 2006 - 11:08

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

AttachmentSize
not-always-thumb_0.patch 3.14 KB
 
 

Drupal is a registered trademark of Dries Buytaert.