Summary
The plugin causes a loop which results in a fatal error:
Fatal error: Allowed memory size of 134217728 bytes exhausted
Step to reproduce
On MODX 3 using pdoTools 3.0.0-beta:
- Create a setting with field type: Image
- Add a value to the newly created field (without the value, the error is not triggered)
The error should now be triggered in both the MODX manager & frontend.
Observed behavior
The client config plugin listens to the pdoToolsOnFenomInit event, which triggers the parseProperties in the modMediaSource class which triggers the loop:
public function parseProperties(array $properties)
{
if (empty($properties)) {
$properties = $this->getProperties();
}
$this->xpdo->getParser();
if ($this->xpdo->parser) {
foreach ($properties as &$property) {
$this->xpdo->parser->processElementTags('', $property['value'], true, true);
}
}
return $properties;
}
Because the constructor of ModxPro\PdoTools\Parsing\Fenom\Fenom includes the invokeEvent:
$this->modx->invokeEvent(
'pdoToolsOnFenomInit',
[
'fenom' => $this,
'config' => $pdoTools->config(),
]
);
This keeps triggering the clientconfig event resulting in the allowed memory exhausted error.
Expected behavior
I'd expect that the ClientConfig plugin is only triggered once for the pdoToolsOnFenomInit event.
Environment
MODX3
PDOTools 3.0.0 beta
ClientConfig 2.3.0
Summary
The plugin causes a loop which results in a fatal error:
Fatal error: Allowed memory size of 134217728 bytes exhaustedStep to reproduce
On MODX 3 using pdoTools 3.0.0-beta:
The error should now be triggered in both the MODX manager & frontend.
Observed behavior
The client config plugin listens to the
pdoToolsOnFenomInitevent, which triggers the parseProperties in the modMediaSource class which triggers the loop:Because the constructor of ModxPro\PdoTools\Parsing\Fenom\Fenom includes the invokeEvent:
This keeps triggering the clientconfig event resulting in the allowed memory exhausted error.
Expected behavior
I'd expect that the ClientConfig plugin is only triggered once for the pdoToolsOnFenomInit event.
Environment
MODX3
PDOTools 3.0.0 beta
ClientConfig 2.3.0