Answer the question
In order to leave comments, you need to log in
[[!If? does not output chunks. Or is the problem deeper? How to fix?
Hello. Please tell me what I'm doing wrong:
There is a chunk:
[[!If?
&subject=`[[!smrProfileUserEditStatus]]`
&operator=`inarray`
&operand=`2,3`
&then=`[[$smrProfileRequestUserEditDisabled]]`
&else=`[[$smrProfileRequestUserEditEnabled]]`
]]
[[!smrProfileUserEditStatus]]
, returns 1,2,3 or empty. Checked, it works. Just in case, snippet code:$reqid = $_GET['cpreq'];
$pst = "";
$output = "";
if (is_numeric($reqid)) {
$pst = $modx->getObject('VinZapros', array('id' => $reqid));
$output = $pst->get('prstatus');
}
return $output;
[2015-12-03 18:29:40] (ERROR @ /index.php) `[id]~` is not a valid integer and may not be passed to makeUrl()
[2015-12-03 18:51:55] (WARN @ /manager/components/console/connectors/console.php)
`27` was requested but no alias was located.
[2015-12-03 18:51:55] (WARN @ /manager/components/console/connectors/console.php)
`17` was requested but no alias was located.
[2015-12-03 18:51:55] (ERROR @ /manager/components/console/connectors/console.php)
`[id]~` is not a valid integer and may not be passed to makeUrl()
[2015-12-03 18:51:55] (WARN @ /manager/components/console/connectors/console.php)
`19` was requested but no alias was located.
[2015-12-03 18:51:55] (WARN @ /manager/components/console/connectors/console.php)
`17` was requested but no alias was located.
[2015-12-03 18:51:56] (WARN @ /manager/components/console/connectors/console.php)
`27` was requested but no alias was located.
Answer the question
In order to leave comments, you need to log in
I decided. Fixed links. The errors are gone, but the problem remains. Went by elimination method. And it turned out that inside the [[$smrProfileRequestUserEditEnabled]] and [[$smrProfileRequestUserEditDisabled]] chunks, the [[$smrUserProfileTop]] chunk was called, in which the [[!smrProfileMenu]] snippet was called , containing:
<?php
$idcd = $modx->resource->get('id');
if ($idcd == 27) {
echo "
<li class=\"mrt0\"><a class=\"side\" style=\"border-right: 5px solid #e7e7e7;\" href=\"".$modx->makeUrl(27)."\"><i class=\"fa fa-list-alt mrr15\"></i>Мои заявки</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(17)."\"><i class=\"fa fa-list mrr15\"></i>Мои заказы</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(19)."\"><i class=\"fa fa-user mrr15\"></i>Личные данные</a></li>";
}
else if ($idcd == 17) {
echo "
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(27)."\"><i class=\"fa fa-list-alt mrr15\"></i>Мои заявки</a></li>
<li class=\"mrt0\"><a class=\"side\" style=\"border-right: 5px solid #e7e7e7;\" href=\"".$modx->makeUrl(17)."\"><i class=\"fa fa-list mrr15\"></i>Мои заказы</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(19)."\"><i class=\"fa fa-user mrr15\"></i>Личные данные</a></li>";
}
else if ($idcd == 19) {
echo "
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(27)."\"><i class=\"fa fa-list-alt mrr15\"></i>Мои заявки</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(17)."\"><i class=\"fa fa-list mrr15\"></i>Мои заказы</a></li>
<li class=\"mrt0\"><a class=\"side\" style=\"border-right: 5px solid #e7e7e7;\" href=\"".$modx->makeUrl(19)."\"><i class=\"fa fa-user mrr15\"></i>Личные данные</a></li>";
}
else {
echo "
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(27)."\"><i class=\"fa fa-list-alt mrr15\"></i>Мои заявки</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(17)."\"><i class=\"fa fa-list mrr15\"></i>Мои заказы</a></li>
<li class=\"mrt0\"><a class=\"side\" href=\"".$modx->makeUrl(19)."\"><i class=\"fa fa-user mrr15\"></i>Личные данные</a></li>";
}
I know that it’s a three-story bike, but actually, after expelling its call to a higher level, actually in the body of the document itself:[[$smrUserProfileTop]]
[[!If?
&subject=`[[!urlGetValue? &field=`cpreq`]]`
&operator=`empty`
&then=`[[$smrProfileRequestUserList]]`
&else=`[[$smrProfileRequestUserEditSwitch]]`
]]
[[$smrUserProfileBottom]]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question