Skip to content

Commit fc2bdf6

Browse files
authored
Merge pull request #198 from modmore/guard-against-fenom-loop
Prevent pdoToolsOnFenomInit triggering more than once
2 parents 4b77ea4 + 9d9bb9d commit fc2bdf6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

core/components/clientconfig/elements/plugins/clientconfig.plugin.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
case 'OnMODXInit':
3737
case 'OnHandleRequest':
3838
case 'pdoToolsOnFenomInit':
39+
// Measure to guard against pdoTools fenom parser loop bug: https://github.com/modmore/ClientConfig/issues/192
40+
// Here we only allow the pdoToolsOnFenomInit event to trigger the first time.
41+
if ($eventName === 'pdoToolsOnFenomInit') {
42+
if ($modx->getOption('clientconfig.fenom_initialized')) {
43+
return;
44+
}
45+
$modx->setOption('clientconfig.fenom_initialized', true);
46+
}
47+
3948
/* Grab the class */
4049
$path = $modx->getOption('clientconfig.core_path', null, $modx->getOption('core_path') . 'components/clientconfig/');
4150
$path .= 'model/clientconfig/';

0 commit comments

Comments
 (0)