In the current cvs version (1.15) of gallery.module the block options are not correctly stored. The problem is related to the expected value for selected checkboxes: the module seems to expect 1 if the option is select, while in reality drupal gives the name of the option if it is selected and 0 if it isn't.

This problem is easily fixed, change:

variable_set('gallery_block_block_' . $delta, array_keys($edit['gallery_block_block_' . $delta], 1));
by
variable_set('gallery_block_block_' . $delta, array_filter($edit['gallery_block_block_' . $delta]));

and

variable_set('gallery_block_show_' . $delta, array_keys($edit['gallery_block_show_' . $delta], 1));
by
variable_set('gallery_block_show_' . $delta, array_filter($edit['gallery_block_show_' . $delta]));

Cheers,
Chris.

Comments

Johnyp’s picture

I've tried to remove the "1" from the lines noted above, but this produces the exact oposite problem.
All the boxes now stay checked, producing a huge image block with 12 images in a raw (which can't be changed). Now block things all the items are selected and is remebering it that way.

Any fix that can be applied by hand, which would work?

Johnyp’s picture

My fault - missed the "filter" part of the change. Now everything seems to work.

thanks

cosmicdreams’s picture

I'm confused. I've got all the options checked now. I can't seem to uncheck some options. how do I fix this?

cosmicdreams’s picture

O, silly me. I made the same mistake as the last guy. For those reading, be sure to change array_keys to array_filter

chrisd’s picture

This code change worked for me on (4.7.0B4) ...please update CVS ?

Thank you chrisvdb,
Christophe D

kiz_0987’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Fixed.