function brilliant_gallery_get_picasa_hidden_imagenames() returns a non-existent array if the file "picasa.ini" doesn't exists.
This results in:
Notice: Undefined variable: filenames in brilliant_gallery_get_picasa_hidden_imagenames() (line 540 of /xxx/sites/all/modules/contrib/brilliant_gallery/brilliant_gallery_functions.inc).
and
Warning: in_array() expects parameter 2 to be array, null given in load_dir_to_array() (line 37 of /xxx/sites/all/modules/contrib/brilliant_gallery/brilliant_gallery_functions.inc).

CommentFileSizeAuthor
#1 brilliant_gallery_2446565.patch703 bytesPROMES
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PROMES’s picture

Attached a patch to correct the problem.

fchandler’s picture

I applied this patch
got this message in the process.
patching file /var/www/html/nellchandler.com/sites/all/modules/brilliant_gallery/brilliant_gallery_functions.inc
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 501 with fuzz 1.
Don't know what any of that means, but the error message is gone.

fkelly12054@gmail.com’s picture

I'm not familiar with the patching process. The problem with the brilliant_gallery_get_picasa_hidden_imagenames function as originally written, is that the variable $filenames does not get defined unless there is a picasa.ini file. The patch appears to add:

$filenames = array();

right after the function declaration so that it will always be defined at the time that the return statement is executed at the end of the function. That's all that's needed.

There does appear to be a superfluous declaration of $filenames at line 503 of the current program. I don't think it will do any harm but probably best to get rid of it.

I know the "official" thing to do is to patch the files, but personally I'd just save off a backup copy of the program and then edit it directly.

drpchris’s picture

I arrived at this independently. This minor fix should be picked up!

drpchris’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
Status: Active » Fixed

Looks like it was committed but is only in 7.x-1.x-dev release right now. Maybe 7.x-1.9 when it gets made...
http://cgit.drupalcode.org/brilliant_gallery/commit/?id=6ec48d28f90bcd20...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.