Unable to Search While Logged In

3 posts / 0 new
Last post
Unable to Search While Logged In

Bit of an odd one here,

I discovered that any time a user is logged in, they are unable to search for database items. However, if they are not logged in, the search function works perfectly.

This is the error that is generated when a user attempts to search:

Uncaught Exception

Message:Invalid metadata field ID (-1)

#0 /site/www/cwis/objects/PrivilegeSet.php(369): MetadataField->__construct(-1)
#1 /site/www/cwis/objects/ResourceFactory.php(682): PrivilegeSet->FieldsWithUserComparisons('==')
#2 /site/www/cwis/objects/ResourceFactory.php(651): ResourceFactory->CheckUserComparisons(Object(CWUser), '==')
#3 /site/www/cwis/objects/ResourceFactory.php(300): ResourceFactory->InUserComparisons(Object(CWUser))
#4 /site/www/cwis/pages/AdvancedSearch.php(1079): ResourceFactory->FilterNonViewableResources(Array, Object(CWUser))
#5 /site/www/cwis/lib/ScoutLib/ApplicationFramework.php(408): include('/site/www/cwis...')
#6 /site/www/cwis/index.php(65): ApplicationFramework->LoadPage('AdvancedSearch')
#7 {main}

System Information

CWIS Version


PHP Version


MySQL Version


Re: Unable to Search While Logged In

It appears that your permission settings contain an invalid entry. It looks like you have a "User is the value of XX" condition somewhere, either in your per-field permissions or your permisions, but field XX does not exist (or doesn't exist anymore?).

In the permission editor, this would show up as "INVALID FIELD". If nothing jumps out there, could you run the following sql and email me the result (chalpin@scout.wisc.edu)?

SELECT SchemaId, ViewingPrivileges FROM MetadataSchemas;

SELECT FieldId, ViewingPrivileges FROM MetadataFields;

From that I should be able to determine where the problem lies.

Also, you may wish to upgrade to CWIS 3.2.0. It contained a few small bugfixes for the permission editor, though not a fix for the specific problem you're seeing here.

Re: Unable to Search While Logged In

It looks like upgrading to CWIS 3.2.0 has solved the problem. I was a little worried about overwriting the existing database when I saw that message during the installation process. Thanks for the assistance, you guys are doing a great job!