I get this error when the gallery block is enabled. I can still see the image, but the error appears at the top of the page.

warning: implode(): Bad arguments. in xxxxxxxx/modules/gallery.module on line 190.

Comments

esskay’s picture

If I comment out the line, the problem goes away in the block. But I don't know what other function I've broken.

kiz_0987’s picture

Have you deselected all the "image data" checkboxes in the configuration page? If so, that may explain why it fails. You need at least one selected or you will get an implode error.

pitpit’s picture

Status: Active » Needs review

line 190 replace

$params['show'] = implode('|', variable_get('gallery_block_show_' . $delta, array()));

with

if (is_array($param_show_array))
  $params['show'] = implode('|', $param_show_array);
else
  $params['show'] = "";

and you'll be able to deselect all image data in the Gallery Block configuration

pitpit’s picture

Component: User interface » Code

oups i made a mistake...

line 190 replace

$params['show'] = implode('|', variable_get('gallery_block_show_' . $delta, array()));

with

$param_show_array=variable_get('gallery_block_show_' . $delta, array());
if (is_array($param_show_array))
  $params['show'] = implode('|', $param_show_array);
else
  $params['show'] = "";

and you'll be able to deselect all image data in the Gallery Block configuration

ethang’s picture

Status: Needs review » Closed (won't fix)

After applying that patch my gallery turns into an empty page with this error:

Parse error: parse error, unexpected T_VARIABLE in /home/crawford/public_html/modules/gallery.module on line 182

Unfortunately I can't decode the meaning of that. So I changed back to original gallery.module and I'm still getting the error:

warning: implode(): Bad arguments. in /home/crawford/public_html/modules/gallery.module on line 190

If I remove the gallery block altogether, the error dissapears and my gallery functions perfectly... what is the purpose of having the gallery block enabled?

Another question: how can I remove/disable all of the multiple headings on the gallery page? You can see on my site: ethancrawford.com/photography - All the headers ("E.C. Photography") are a waste of space. And Any idea how I can remove all the blank space between my page header and the gallery? Many thanks,

ethang’s picture

Status: Closed (won't fix) » Active
pitpit’s picture

are you using the last CVS version of gallery.module ?

ethang’s picture

yes, I'm using the latest gallery.module (1.10) and the latest release of gallery (2.0).

If the gallery block is disabled my gallery appears to work just fine. If I enable it, and also select some image data types, I get an error under my main header "Unable to get Gallery image block." If I disable all the image data types, I get the "warning: implode():" error and also the "Unable to get Gallery image block" error.

I've tried a few different patches with no success, so I've kept the gallery block disabled.

kiz_0987’s picture

Hmm, do you have the "Image Block" module installed in your gallery2 installation? Does it work there when you have a random image in your sidebar?

ethang’s picture

That did the trick- I didn't have the image block module installed. Thanks everybody.

pitpit’s picture

Hi,
Do the patch work for you now ?

ethang’s picture

I installed the enhanced gallery.module, and it looks like your patch is there, but commented out... should I de-comment it? Do you have a copy of gallery.module with your patch?

pitpit’s picture

Version: 4.6.x-1.x-dev » master

The enhanced gallery.module contains this patch (actually it's not commented out) so you don't need to alter your new gallery.module if you installed it. And you should not have implode warning yet

Dpdev

pitpit’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)