I’m using the code suggested above to process a chunk stored in a file
<?php
$tpl = file_get_contents($tplFile);
$chunk = $modx->newObject('modChunk');
$chunk->setCacheable(false);
$output = $chunk->process($scriptProperties, $tpl);
but I have chunks with element tags in them e.g.
Some stuff up here
[[!Login]]
when $chunk->process is called the [[!Login]] element is not processed and the text [[!Login]] is just displayed in the output.
I’ve looked into a little bit and made a change in modchunk->process
I changed this line:
$this->xpdo->parser->processElementTags($this->_tag, $this->_output, false, false, '[[', ']]', array(), $maxIterations);
to this:
$this->xpdo->parser->processElementTags($this->_tag, $this->_output, true, true, '[[', ']]', array(), $maxIterations);
So now its processing uncachable elements and removing unprocessed elements.
This of course is just hacking and I have no idea of the wider impacts of this change. Is there a better way around this problem??