revolution
revolution copied to clipboard
toPlaceholders wrong behavior
Bug report
Summary
If an array value is empty toPlaceholders function does not clear the value in placeholder and leaves the previous value.
Step to reproduce
here is the result:
here is my code for the reproducing issue:
$item = $object->toArray(); echo "<pre>Object Data: {$item['ends_at']} <br>"; $modx->toPlaceholders( $object, 'subscription'); echo "placeholder: {$modx->getPlaceholder( 'subscription.ends_at' )}</pre>";
Expected behavior
the function should clear the placeholder if the value is NULL or empty.
Environment
MODX Revolution 3.0.1-pl (traditional) PHP Version 8.0.25 Ubuntu FPM/FastCGI paas2.fra.modxcloud.com 10.3.34-MariaDB-0ubuntu0.20.04.1