"Passed variable is not an array or object" error (in log) after hosting company did upgrades

sswitzer

Joined: 2014-07-14
Posts: 3
Posted: Wed, 2014-07-16 16:39

My hosting company did some upgrades of their server and a previously working Gallery3 has now stopped working. I'm getting the generic "Dang, something went wrong" error, and here's what I'm seeing in the error log:

2014-07-14 18:22:37 +00:00 --- error: InvalidArgumentException [ 0 ]: Passed variable is not an array or object, using empty array instead
/home/learn/public_html/gallery3/modules/gallery/helpers/theme.php [ 106 ]
#0 /home/learn/public_html/gallery3/modules/gallery/helpers/theme.php(106): ArrayObject->__construct(NULL, 2)
#1 /home/learn/public_html/gallery3/modules/gallery/libraries/Theme_View.php(46): theme_Core::get_info('wind')
#2 /home/learn/public_html/gallery3/modules/gallery/controllers/albums.php(63): Theme_View_Core->__construct('page.html', 'collection', 'album')
#3 [internal function]: Albums_Controller->show(Object(Item_Model))
#4 /home/learn/public_html/gallery3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Albums_Controller), Array)
#5 [internal function]: Kohana_Core::instance(NULL)
#6 /home/learn/public_html/gallery3/system/core/Event.php(208): call_user_func_array(Array, Array)
#7 /home/learn/public_html/gallery3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#8 /home/learn/public_html/gallery3/index.php(116): require('/home/learn/pub...')
#9 {main}


Gallery version (not just "2"): 3.0.9
PHP version (e.g. 5.1.6): 5.4.3
PHPInfo Link (see FAQ): http://www.learnsailing.org/gallery3/phpinfo.php
Webserver (e.g. Apache 1.3.33): Not sure
Database (e.g. MySql 5.0.32): MySql 5.5.37
Activated toolkits (e.g. NetPbm, GD): Not sure
Operating system (e.g. Linux): Linux
Browser (e.g. Firefox 2.0): Firefox 30

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2014-07-16 23:00

This user had the same issue:
http://galleryproject.org/node/111945
some php configuration issue that was not detailed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sswitzer

Joined: 2014-07-14
Posts: 3
Posted: Thu, 2014-07-17 16:40

OK -- So it looks like my hosting company has disabled parse_ini_file:

(from http://www.learnsailing.org/gallery3/phpinfo.php )

disable_functions passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source

Since I couldn't re-enable parse_ini_file, I went hacky and hard-coded in my theme info into modules/gallery/helpers/theme.php get_info:

$theme_info = new ArrayObject(array(),ArrayObject::ARRAY_AS_PROPS);
if ($theme_name=="wind") {
	$theme_info->name = "Gallery Wind";
	$theme_info->description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience.";
	$theme_info->version = 1;
	$theme_info->author = "Gallery Team";
	$theme_info->site = 1;
	$theme_info->admin = 0;
	$theme_info->author_name = "Gallery Team";
	$theme_info->author_url = "http://codex.galleryproject.org/Gallery:Team";
	$theme_info->info_url = "http://codex.galleryproject.org/Gallery3:Themes:wind";
	$theme_info->discuss_url = "http://galleryproject.org/forum_theme_wind";
}
if ($theme_name=="admin_wind") {
	$theme_info->name = "Gallery Wind";
	$theme_info->description = "A crisp Site Administration theme with soft colors and drop down menus.";
	$theme_info->version = 1;
	$theme_info->author = "Gallery Team";
	$theme_info->admin = 1;
	$theme_info->site = 0;
	$theme_info->author_name = "Gallery Team";
	$theme_info->author_url = "http://codex.galleryproject.org/Gallery:Team";
	$theme_info->info_url = "http://codex.galleryproject.org/Gallery3:Themes:admin_wind";
	$theme_info->discuss_url = "http://galleryproject.org/forum_theme_admin_wind";
}