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
Comment #1
Johnyp commentedI'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?
Comment #2
Johnyp commentedMy fault - missed the "filter" part of the change. Now everything seems to work.
thanks
Comment #3
cosmicdreams commentedI'm confused. I've got all the options checked now. I can't seem to uncheck some options. how do I fix this?
Comment #4
cosmicdreams commentedO, silly me. I made the same mistake as the last guy. For those reading, be sure to change array_keys to array_filter
Comment #5
chrisd commentedThis code change worked for me on (4.7.0B4) ...please update CVS ?
Thank you chrisvdb,
Christophe D
Comment #6
kiz_0987 commentedFixed.