revolution icon indicating copy to clipboard operation
revolution copied to clipboard

toPlaceholders wrong behavior

Open krava77 opened this issue 2 years ago • 3 comments

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

krava77 avatar Jan 30 '23 16:01 krava77