I’ve run into this while creating forms that post arrays of data, but it seems that the MODx parser doesn’t like processing stuff like this:
$tpl = '<input name="deep[[[+id]]][attribute]" value="[[+some_value]]" type="hidden" />';
$modChunk = $modx->newObject('modChunk');
$modChunk->setCacheable(false);
$modChunk->setContent($tpl);
$record = array('id'=>123, 'some_value'=>'xyz');
return $modChunk->process( $record );
If I put spaces around the [[+id]], e.g. name="deep[ [[+id]] ][attribute]" then it works and parses correctly, but if I don’t do that, the [[+id]] doesn’t ever get replaced with the corresponding value.
Is this another +1 senility thing I’ve got going on?