Hi guys,
I'm developing a site in modx and I stumbled upon this issue as well.
I have implemented a fix, it's rather crude but doesn't really change any of the logic hugely. I thought I'd post it here just in case anybody has a similar issue. I've learnt so much from these foums just thought I'd give something back.
On line 444 add:
$isOdd = false;
if ($idx > 1 && empty($resourceTpl)) {
On line 450 add the following right after the template parse call:
On line 461 add the following new condition into the if statement:
if ($idx == $last && ($isOdd || empty($resourceTpl)) && !empty($tplLast)) {
$resourceTpl = parseTpl($tplLast, $properties);
}
Here's the whole lot as it should look:
...
$isOdd = false;
if ($idx > 1 && empty($resourceTpl)) {
$divisors = getDivisors($idx);
if (!empty($divisors)) {
foreach ($divisors as $divisor) {
$tplnth = 'tpl_n' . $divisor;
if (!empty($$tplnth)) {
$resourceTpl = parseTpl($$tplnth, $properties);
$isOdd = true;
if (!empty($resourceTpl)) {
break;
}
}
}
}
}
if ($idx == $first && empty($resourceTpl) && !empty($tplFirst)) {
$resourceTpl = parseTpl($tplFirst, $properties);
}
if ($idx == $last && ($isOdd || empty($resourceTpl)) && !empty($tplLast)) {
$resourceTpl = parseTpl($tplLast, $properties);
}
...
Hope this helps anybody with this issue.