I have a fresh install of MODX 2.5.1 with a few Extras installed including pdoTools. Something odd is going on with the value being output for a Placeholder. The issue is resolved by uninstalling pdoTools.
The Placeholder value is set by a snippet eg. [[regFile? &item=`file1`]]. Each time the snippet is called the value passed by &item is concatenated to the previous value and stored in the placeholder.
Calling [[regFile? &item=`file1,file3`]] then calling [[regFile? &item=`file7`]] results in [[+myPlaceholder]] being set to: file1,file3,file7
So far so good.
At the end of my Template a second snippet [[outputScripts]] is called. It parses myPlaceholder and returns an HTML block with script tags based on the files stored in the Placeholder eg.
<script src="file1.js"></script>
<script src="file3.js"></script>
<script src="file7.js"></script>
However when placed at the end of my Template it returns
<script src="file1.js"></script>
<script src="file3.js"></script>
If I change the [[regFile]] snippet to output the current Placeholder value each time it is called the Placeholder value is correct, after the second call the 3 .js files are included.
If both snippets also output the current microtime() you can see that [[outputScripts]] is called before [[regFile]] even though [[outputScripts]] is the last tag in my Template. To illustrate:
0.624 [[regFile]]
0.911 [[regFile]]
0.896 [[outputScripts]] <<< this should be the 3rd event but the timer shows it is the 2nd.
I don't know why but calling [[!outputScripts]] uncached while pdoTools is installed also resolves the issue.
Changing the System Setting for pdotools_fenom_default to No has no effect (I don't think it should though, I think this relates to the way pdoTools snippets handle Chunks).
Disabling the pdoTools Plugin has no effect.
Can anyone suggest what might be the cause or how I can investigate further?
The issue seems vaguely similar to the Placeholder issue which was influenced by pdoTools reported at
https://www.bountysource.com/issues/33123926-issue-defined-placeholders-have-to-be-uncached-in-order-to-use-output-modifiers-in-2-4-4