So I have discovered, that the URI must look like this:
http://localhost/4golf.sk-modx/vyrobcovia?ditto_ShopProducers_orderBy=pagetitle%20ASC
And the the parameter is passed to the to the right array, thus to this array:
$variables[$saneName] = trim($value);
The whole code in request extender looks exactly like this:
foreach ($_REQUEST as $name=>$value) {<br /> $saneName = str_replace($dittoID, "", substr($name, 6));<br /> $dID = ($dittoID == "") ? true : strpos($name, $dittoID);<br /> if ((substr($name, 0, 6) == "ditto_" && $dID) && !in_array($saneName,$bad) && ($good == false || in_array($saneName,$good)) && !ereg("[\^`~!/@\\#\}\$%:;\)\(\{&\*=\|’\+]", $value)){<br /> if ($stripTags) $var = $modx->stripTags($value);<br /> $variables[$saneName] = trim($value);<br /> }<br />}
But if all conditions are accomplished I get this error:
« MODx Parse Error »<br />MODx encountered the following error while attempting to parse the requested resource:<br />« PHP Parse Error »<br /> <br />PHP error debug<br /> Error: Invalid argument supplied for foreach() <br /> Error type/ Nr.: Warning - 2 <br /> File: E:\htdocs-ganymede\4golf.sk-modx\assets\snippets\ditto\classes\ditto.class.inc.php <br /> Line: 158 <br /> Line 158 source: foreach ($orderBy[’parsed’] as $item) {
So I have debugged whole request extender and I have discovered, that the URI must look like this:
http://localhost/4golf.sk-modx/vyrobcovia?ditto_ShopProducers_sortBy=pagetitle&ditto_ShopProducers_sortDir=ASC
There is inconsitency between orderBy in newest Ditto 2.1 and old parameters, so sortBy and sortDir, I think that this should be join together, so the URI have to look like this:
http://localhost/4golf.sk-modx/vyrobcovia?ditto_ShopProducers_orderBy=pagetitle%20ASC
I don’t know if it’s necessary
ditto_ShopProducers_orderBy, but if not it could be simply
ShopProducers_orderBy
If author of this snippet give me some info, so I can create patch for this.