Here's the SQL from the new wayfinder in 1.2
SELECT DISTINCT sc.id,sc.menutitle,sc.pagetitle,sc.introtext,sc.menuindex,sc.published,sc.hidemenu,sc.parent,sc.isfolder,sc.description,IF(sc.alias='', sc.id, sc.alias) AS alias,sc.longtitle,sc.type,IF(sc.type='reference',sc.content,'') AS content,sc.template,sc.link_attributes
FROM
dev.modx_site_content sc
LEFT JOIN
dev.modx_document_groups dg ON dg.document=sc.id
WHERE
sc.published=1
AND sc.deleted=0
AND(sc.privateweb=0)
AND sc.hidemenu=0
AND sc.id IN (277,1,96,518,519,515,520,531,299,270,398,106,206,199,107,184,390,139,97,205,391,111,279,98,101,99,113,100,102,103,128,132,131,244,129,130,133,229,230,385,384,231,383,381,228,232,382,294,127,386,387,388,389,413,530,251,392,394,406,51,52,254,255,67,53,68,54,94,272,59,60,87,560,61,289,549,271,47,445,278,425,407,631,419,439,607,357,358,447,448,630,627,449,150,105,147,115,377,281,415,370,283,267,191,461,84,258,437,11,80,296,297,410,426,427,430,431,494,582,595,310,522,523,373,529,363,524,621,362,558,545,112,516,71,593,86,353,464,465,469,474,480,483,487,489,495,498,512,90,114,118,120,123,125,126,141,142,143,148,180,182,183,207,246,262,276,428,594,286,450,588,287,600,601,290,376,606,608,411,412,414,615,624,625,311,312,429,249,432,433,360,355,248,284,7,4,211,124,614,616,617,618,626,620,629,265,259,521,417,306,505,506,568,504,532,576,365,367,535,554,89,346,348,88,534,553,416,543,315,295,62,609,314,587,263,533,452,507,619,93,91,589,599,598,540,566,623,567,379,438,422,564,592,181,145,185,186,187,189,192,239,240,245,257,261,264,269,275,285,316,302,304,305,356,364,368,288,375,380,361,369,374,395,446,575,418,451,503,511,526,528,539,546,547,548,551,552,556,559,580,581,584,597,603,628,308,85,188,75,273,144,92,77,79,78,76,424,266,577,6,74,454,460,458,602,456,457,596,455,565,508,542,463,622,510,525,555,605,46,420,421,590,591,604,253,291,307,293,557)
GROUP BY sc.id
ORDER BY sc.menuindex ASC
Here's the old wayfinder:
SELECT DISTINCT sc.id, sc.menutitle, sc.pagetitle, sc.introtext, sc.menuindex, sc.published, sc.hidemenu, sc.parent, sc.isfolder, sc.description, IF(sc.alias='', sc.id, sc.alias) AS alias, sc.longtitle, sc.type,if(sc.type='reference',sc.content,'') as content, sc.template, sc.link_attributes
FROM
`dev`.`modx_site_content` sc
LEFT JOIN
`dev`.`modx_document_groups` dg ON dg.document = sc.id
WHERE
sc.published=1
AND sc.deleted=0
AND (sc.privateweb=0 OR dg.document_group IN (1,2,4,4,2,3,3,2,3,5,6,6,8,9,9,8,9,10,12,11,17))
AND sc.hidemenu=0
AND sc.id IN (277,1,96,518,519,515,520,531,299,270,398,106,206,199,107,184,390,139,97,205,391,111,279,98,101,99,113,100,102,103,128,132,131,244,129,130,133,229,230,385,384,231,383,381,228,232,382,294,127,386,387,388,389,413,530,251,392,394,406,51,52,254,255,67,53,68,272,54,94,59,60,87,560,61,289,549,271,47,445,278,425,407,631,419,439,607,357,358,447,627,630,448,449,150,105,147,115,430,410,426,427,582,377,461,431,281,415,370,595,283,267,191,84,297,258,650,494,11,437,80,296,642,310,363,373,621,523,522,524,529,362,558,545,112,516,71,593,86,353,464,465,469,474,480,483,487,489,495,498,512,90,114,118,120,123,125,126,141,142,143,148,180,182,183,207,246,262,276,428,594,286,450,588,287,600,601,290,376,606,608,411,412,414,615,624,625,641,311,312,429,249,432,433,360,355,248,284,7,4,211,124,614,616,617,618,626,620,629,644,645,265,259,521,417,306,505,506,568,504,532,576,365,367,554,535,89,346,348,88,534,553,416,543,315,295,62,609,314,587,263,533,452,507,619,93,91,589,599,598,643,540,566,623,567,379,438,422,564,592,181,145,185,186,187,189,192,239,240,245,257,261,264,269,275,285,316,302,304,305,356,364,368,375,288,361,380,395,374,369,575,446,418,451,503,511,526,528,539,546,547,548,551,552,556,559,581,580,584,597,603,628,640,646,308,85,188,75,273,144,92,77,79,78,76,266,424,577,6,74,454,460,456,458,602,596,457,455,565,542,508,463,510,622,525,555,605,46,420,421,590,591,604,253,291,293,307,557,639,651)
GROUP BY sc.id
ORDER BY sc.menuindex ASC
The first SQL statement gets me 7 results returned whilst the 2nd returns a 196 results. The first is wrong where as the second is correct.
The difference is
AND (sc.privateweb=0 OR dg.document_group IN (1,2,4,4,2,3,3,2,3,5,6,6,8,9,9,8,9,10,12,11,17))
which means this in the new code
if($modx->isFrontend()) {
if(!$this->_config['showPrivate']) {
$access = "sc.privateweb=0";
}
}
else {
$access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']);
if($docgrp) $access .= sprintf(' OR dg.document_group IN (%s)', $docgrp);
}
vs this in the old code isn't working as it used to
$access = ($modx->isFrontend() ? "sc.privateweb=0" : "1='{$_SESSION['mgrRole']}' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ({$docgrp})");
I've added the old line in to override the new code so I don't have to showPrivate.
I hope this is helpful.
[ed. note: BBloke last edited this post 9 years, 9 months ago.]