Quote from: TimGS at Mar 10, 2011, 11:17 PM
Puzzling, as it works fine in Evo.
If you search for terms that are included in both public and private areas, but are not logged in and hence do not have access to the private pages, what happens?
If you search for terms that are included nowhere at all what happens?
What I am after is whether it is just no finds that is a problem, or whether there is a problem searching private pages that are currently inaccessible to the user.
Look for the line define(’DEBUG’, 0); and change 0 to 1. Post the output.
-- Tim.
Hi, Tim.
With DEBUG on, if I search for a term that exists in both public and private pages while not logged in, it returns only the public results...
Search Terms array: array(1) { [0]=> string(10) "pubprivtest" }
Search Terms negative array: array(0) { }
Neg query 1:
Neg query 2:
SELECT id, editedon FROM `modx`.`modx_site_content` WHERE published = 1 AND searchable = 1 AND deleted=0 AND (((`modx`.`modx_site_content`.pagetitle LIKE '%pubprivtest%') OR (`modx`.`modx_site_content`.longtitle LIKE '%pubprivtest%') OR (`modx`.`modx_site_content`.introtext LIKE '%pubprivtest%') OR (`modx`.`modx_site_content`.content LIKE '%pubprivtest%')))
First Pass: array(1) { [14]=> array(2) { ["count"]=> int(1) ["date"]=> string(10) "1296837339" } }
Doc ID 14 contains the term "pubprivtest", but so does doc ID 32, which is not listed.
Correction... the term exists in a TV on doc 32. If I move the term to the content field, the private page result is also listed, and the page breaks as noted below for the private only search.
If I search for a term that exists nowhere on the site, I get a normal "No Results Found" response.
If I search for a term that only exists on a private page while not logged in, I get a blank (untemplated) page with this:
Search Terms array: array(1) { [0]=> string(8) "privatetest" }
Search Terms negative array: array(0) { }
Neg query 1:
Neg query 2:
SELECT id, editedon FROM `modx`.`modx_site_content` WHERE published = 1 AND searchable = 1 AND deleted=0 AND (((`modx`.`modx_site_content`.pagetitle LIKE '%privatetest%') OR (`modx`.`modx_site_content`.longtitle LIKE '%privatetest%') OR (`modx`.`modx_site_content`.introtext LIKE '%privatetest%') OR (`modx`.`modx_site_content`.content LIKE '%privatetest%')))
First Pass: array(2) { [20]=> array(2) { ["count"]=> int(1) ["date"]=> string(10) "1299685039" } [21]=> array(2) { ["count"]=> int(1) ["date"]=> string(10) "1299790412" } }
It clearly finds private docs 20 and 21, neither of which I have permission to view.
Strange, eh?
If the search term is in a TV on a private page, it is ignored unless I am logged-in. But, if the term is in a normal document field like pagetitle or content, it shows up whether I have permissions or not and fouls things up.
-Mike