Closed
Description
Summary
When passing an associative array
to $modx->parseChunk()
, the values parsed in are not given priority processing order, and therefore are not always honored if you have a conflicting, preexisting placeholder set before it.
Step to reproduce
-
Create a Plugin (
OnWebPageInit
) that sets a placeholder on each request:$modx->setPlaceholder('example', 'ABC' );
-
Create a Chunk (example) that outputs the placeholder:
Example: [[+example]]
-
Create and run a Snippet, invoking
parseChunk
, but with custom values:return $modx->parseChunk( 'example', array( 'example' => 'XYZ' ) );
Observed behavior
Output = Example: ABC
The parseChunk
method calls getChunk
resulting in the conflicting placeholder being merged first, prior to parsing the array
values provided.
Expected behavior
Output = Example: XYZ
Environment
MODX 2.3.4-dev