Module listing failing

Hi I hope someone can help me with this. when going to a module, eg ‘accounts’, and search, it fails. I can then no longer get a listing of accounts, unless going via advanced search. When I look in the suitecrm.log I see the following:

12/01/15 12:24:24 [4276][23245648-bd2e-cc97-3e24-559a63a2255e][FATAL] Query Failed:SELECT TOP 21 * FROM
(
SELECT accounts.id ,accounts_cstm.epos_version_c,accounts_cstm.sla_contract_expiry_c,accounts_cstm.support_level_c, accounts.assigned_user_id , accounts.name , accounts.billing_address_city , accounts.phone_office , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , N’Users’ assigned_user_name_mod, accounts.date_entered , accounts.created_by , ROW_NUMBER()
OVER (ORDER BY accounts.date_entered DESC) AS row_number
FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c LEFT JOIN users jt0 ON accounts.assigned_user_id=jt0.id AND jt0.deleted=0

AND jt0.deleted=0 where ((accounts.id IN (SELECT favorites.parent_id FROM favorites
WHERE favorites.deleted = 0
and favorites.parent_type = “Accounts”
and favorites.assigned_user_id = “1”) OR NOT (0))) AND accounts.deleted=0
) AS a
WHERE row_number > 0::: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]An expression of non-boolean type specified in a context where a condition is expected, near ‘)’.
12/01/15 12:24:35 [3812][23245648-bd2e-cc97-3e24-559a63a2255e][FATAL] Query Failed:SELECT TOP 21 * FROM
(
SELECT accounts.id ,accounts_cstm.epos_version_c,accounts_cstm.sla_contract_expiry_c,accounts_cstm.support_level_c, accounts.assigned_user_id , accounts.name , accounts.billing_address_city , accounts.phone_office , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , N’Users’ assigned_user_name_mod, accounts.date_entered , accounts.created_by , ROW_NUMBER()
OVER (ORDER BY accounts.date_entered DESC) AS row_number
FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c LEFT JOIN users jt0 ON accounts.assigned_user_id=jt0.id AND jt0.deleted=0

AND jt0.deleted=0 where ((accounts.name like N’%black%’ ) AND ( accounts.id IN (SELECT favorites.parent_id FROM favorites
WHERE favorites.deleted = 0
and favorites.parent_type = “Accounts”
and favorites.assigned_user_id = “1”) OR NOT (0))) AND accounts.deleted=0
) AS a
WHERE row_number > 0::: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]An expression of non-boolean type specified in a context where a condition is expected, near ‘)’.

Can anyone offer any help?

Many Thanks

Roger

Can anyone offer any direction on this? Struggling to solve it.

Many Thanks

Roger

Check the SearchFields.php file in your modules/MODULE/metadate directory. You should see a “favorites_only” item. It seems that even if the checkbox is not clicked, the search for favorites only in basic search is enabled by default. If you don’t use or need the favorites only search, copy the SearchFields.php file in the custom directory of your module, and delete the “favorites_only” item entirely. It worked for me.