Issues with pdoCrumbs and parent chunk output modifier

Summary

Using output modifiers with attributes inside a chunk for pdoCrumbs fails to parse correctly. The chunk outputs the raw [[*parent]] instead of rendering the expected breadcrumb markup.

Step to reproduce

  1. Create a chunk breadcrumbs with the following content:
[[*parent:isnot=`0`:then=`
[[pdoCrumbs?
  &showHome=`1`
  &tpl=`tplOutput`
  &tplHome=`tplHome`
  &tplWrapper=`tplWrapper`
]]`]]
  1. Assign this chunk to a placeholder or insert it directly in a resource template.
  2. Ensure pdoCrumbs works independently (e.g., outside the chunk)
  3. Clear the cache and load the page to see the output.

Observed behavior

The chunk outputs the raw [[*parent]] instead of processing the pdoCrumbs call. If attributes are removed, the chunk works correctly, and pdoCrumbs displays its default templates.

Expected behavior

The chunk should process the pdoCrumbs call with the specified attributes and render the breadcrumb markup as expected on resources that have a parent different than 0.

Environment

  • MODX Revolution 3.0.5-pl (traditional)
  • MySQL 8.0.39-30
  • PHP Version 8.3.14

Notes

  • The issue appears to occur only when output modifiers and attributes are combined.
  • pdoCrumbs works perfectly when called outside `[[*parent:isnot=…]`` with the same attributes.
  • Adding &debug=1 shows no issues.
  • MODX Error Log shows no issues.
[[*parent:isnot=`0`:then=`Hello World!`]] // <-- works exactly as expected
  • Other output modifiers :gt,:ne, etc, give the same error.

I found a workaround: create a snippet instead of using nested chunks and all.

<?php
$parent = $modx->resource->get('parent');
if ($parent != 0) {
  return $modx->runSnippet('pdoCrumbs', [
    'showHome' => 1,
    'tpl' => 'tplOutput',
    'tplHome' => 'tplHome',
    'tplWrapper' => 'tplWrapper'
  ]);
}
return '';

You can also try to use pdoCrumbs parameter &tplHome with empty Tpl or &showAtHome=0

Always a good idea if you have the skills. Much faster and more reliable.

1 Like