My site suddenly developed this weird problem - not sure how. What happens is, I log in as a web user and am directed to the page I have permissions to view on the web and this is all good. THEN I navigate away to most other pages and this mysql error comes up:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - Unknown column '$docgrp' in 'where clause' »
SQL: SELECT DISTINCT `sc`.`id`, `pagetitle`, `description`, editedon AS pubDate FROM `ses`.`modx_site_content` `sc` LEFT JOIN `ses`.`modx_document_groups` `dg` on `dg`.`document` = `sc`.`id` WHERE (`sc`.`privateweb`="0" OR dg.document_group IN ($docgrp)) AND `parent` IN (25,26,27,43,44,54,45,47,55) AND `sc`.`published` = "1" AND `sc`.`hidemenu`="0" AND `sc`.`deleted`="0" ORDER BY editedon DESC LIMIT 10;
The only place I could find the sql was in the siteCache.idx.php file. I know I'm not supposed to but I edited this file to check what was happening. The $docgrp variable was being set ok, but for some reason the line in siteCache.idx.php had to be changed from OR dg.document_group IN ($docgrp) to OR dg.document_group IN ("$docgrp") before the site would read the variable's value instead of the variable name. I have NO idea why this is happening.
Of course, siteCache.idx.php is a dynamic script and is overwritten as things change, so editing the file doesn't help me in the long run.
Can anyone shed some light on either what has caused this problem or may be causing this problem (all still working fine on another install of the site and all I've changed on this install is a few member groups) and/or where I can permanently add "$docgrp" so that it is written like that into the siteCache.idx.php file?
Thank you for your time,
Kathy