Share » Forums » Setup & design » Error when searching

Error when searching

Error when searching

Wednesday 31 August 2005 7:55:36 am - 3 replies

Author Message

Kristof Coomans

Wednesday 31 August 2005 11:48:39 pm

Relevant code in advancedsearch.php:

if ( $http->hasVariable( 'SearchContentClassID' ) and
     $http->variable( 'SearchContentClassID' ) != -1 )
{
    $searchContentClassID = $http->variable( 'SearchContentClassID' );
    $searchContentClass =& eZContentClass::fetch( $searchContentClassID );
    $searchContentClassAttributeArray =& $searchContentClass->fetchSearchableAttributes();
}

I think one of the option values in your template is not a valid content class ID, and eZContentClass::fetch( ) returns false. $searchContentClass is not an object, and you'll get the error.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kjell Inge Sandvik

Thursday 01 September 2005 12:48:04 am

How can I proceed here?

Sandvik Web & Data

Kristof Coomans

Thursday 01 September 2005 12:57:13 am

Check the class ID's of Bilder, Dokumenter and Media.

You can also make the options more dynamic with the following code, if you can assume the class identifiers won't change:

{def $classes=fetch( 'class', 'list', hash( 'class_filter', array( 'bilder', 'dokumenter', 'media' ) ) )}
 
{foreach $classes as $class}
    <option value="{$class.id}">{$class.name|wash}</option>
{/foreach}

{undef $classes}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu