Search Error

6 posts / 0 new
Last post
slewnau
Search Error

Searching worked before I upgraded to CWIS 3.0.  Now when I try to search, I get

Fatal error: Call to undefined method ApplicationFramework::SearchGroups() in /opt/www/htdocs/MORE/dev/objects/SavedSearch.php on line 560

I did echo get_class($this); on the SavedSearch.php page and it gives ApplicationFramework as the class even though the class should be SavedSearch, so I'm at a loss as how to fix this.

Thanks for any help.

chalpin
Re: Search Error

It looks like you have some custom user interface code that is calling GetSearchGroupsAsTextDescription() without a SavedSearch object.

This call either needs to be attached to a SavedSearch object (if there is one to use in that context), or replaced by a call to SavedSearch::TranslateSearchGroupsToTextDescription().  It looks like you're having a problem on index.php?P=SavedSearch .  If so, comparing the contents of your custom SavedSearch.html with interface/default/SavedSearch.html will probably reval the problem.

If you know which release of CWIS was used as the base for your custom user interface, that would help too.  With that information, I could probably point out the specific lines that need to be changed.

FWIW, ApplicationFramework is the expected result of 'echo get_class($this);' from inside a file in pages/.  Since CWIS 2.0.0, index.php has used the ApplicationFramework to assemble pages, so that every page will have a consistent environment.

slewnau
Re: Search Error

Thanks again for the quick reply.

The error is not occuring on the SavedSearch.php page in /pages but in /objects and the calling page is AdvancedSearch.php, index.php?P=AdvancedSearch.

The line calling saved search is:

# build search criteria string to display to user
    $G_SearchCriteria = SavedSearch::GetSearchGroupsAsTextDescription($G_SearchGroups);
 
Before upgrading, we used version 2.04.
 
Also, I tested chaning the active UI to a generic one and still had the error.
 
Thanks again
 
 
chalpin
Re: Search Error

The line you've pasted from pages/AdvancedSearch.php was from CWIS 2.0.4.

In CWIS 3.0.0, it reads:

    # build search criteria string to display to user
    $G_SearchCriteria = SavedSearch::TranslateSearchGroupsToTextDescription(
        $G_SearchGroups, TRUE, FALSE);

Something strange is going on.  The most likely possiblitiy is that CWIS-3.0.0.zip was not fully extracted.  If that were the case, however, you should have seen error messages about incorrect checksums from installcwis.php.

I would suggest unzipping CWIS-3.0.0.zip again, checking carefully for any errors.

slewnau
Re: Search Error

You were right that it was using the old version of AdvanceSearch.php.  Our local/pages/AdvancedSearch.php page was taking precidence over pages/AdvancedSearch.php.  Would your suggestion be to clear out all the files from local/pages?

Thanks Again,

Steve

chalpin
Re: Search Error

It's not generally a good idea to have duplicates of the files under pages/ living under local/pages/.  When the site is upgraded, this has the effect of combining parts from two different versions of CWIS, which can result in very strange behavior.

With older versions of CWIS, it was sometimes necessary to do this anyway, to extend the functionality of particular pages.  We have tried to make this customization possible via our Plugin system instead, so that it is never necessary to duplicate something from pages/ under local/pages/.

If there are no customizations in your duplicate pages, then simply deleting them should resolve the problem.