I'm getting a
Fatal error: Call to a member function on a non-object
when I try to use an embedded search page I put together while using Gallery 2.0, now that I've updated to Gallery 2.1 it's failing.... here's the code:
Quote:
<?php require("gallery/embed.php");?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="Textxlgb"><br>
Gallery Results for "<?php echo $g2_form[searchCriteria]?>":
<?php
$ret = GalleryEmbed::init(array('relativeG2Path' => './gallery/', 'embedUri' => '/search.php','embedPath' => '/gallery/'));
if ($ret->isError()) {
// $ret->getAsHtml() has error details..
exit;
}
$g2data= GalleryEmbed::handleRequest();
echo $g2data["bodyHtml"];
?>
The problem appears to be my call to GalleryEmbed::init, based on the line number it's giving me the error on.
G2.1 Info:
Gallery version = 2.1 core 1.1.0
PHP version = 4.3.11 apache2handler
Webserver = Apache/2.0.54 (Unix) mod_perl/1.99_17 Perl/v5.8.7 mod_ssl/2.0.54 OpenSSL/0.9.7e FrontPage/5.0.2.2635 PHP/4.3.11 mod_webapp/1.2.0-dev mod_python/3.1.4 Python/2.2.2
Database = mysqlt 4.1.11, lock.system=flock
Toolkits = NetPBM, Gd
Acceleration = none, none
Operating system = FreeBSD 206-225-81-13.dedicated.abac.net 5.4-STABLE FreeBSD 5.4-STABLE #1: Mon Oct 3 12:38:17 PDT 2005
:/usr/obj/usr/src/sys/SMP i386
Default theme = matrix
Locale = en_US
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Posts: 32509
how's that related to "search"?
you're pro blem is the $ret->isError() call which is no more the right way to code.
it's all documented on:
http://codex.gallery2.org/index.php/Gallery2:API_Changes_Since_The_Last_Release