I'm getting an error from Auditor: DH\Auditor\Provider\Doctrine\Auditing\Transaction\TransactionProcessor::deepDiff(): Argument #2 ($new) must be of type ?array, string given, called in /srv/app/vendor/damienharper/auditor/src/Provider/Doctrine/Auditing/Transaction/AuditTrait.php on line 210
It's caused by an incorrect assumption that the Doctrine's JSON object can only contain iterables. A string, boolean and a number is a perfectly valid JSON value the field supports. Whether or not it is weird to save a string as a JSON type is out of the scope of this bug report. The fact is that doing so possible, and so it should be handled, edge-case or not.
auditor
versionSummary
I'm getting an error from Auditor:
DH\Auditor\Provider\Doctrine\Auditing\Transaction\TransactionProcessor::deepDiff(): Argument #2 ($new) must be of type ?array, string given, called in /srv/app/vendor/damienharper/auditor/src/Provider/Doctrine/Auditing/Transaction/AuditTrait.php on line 210
It's caused by an incorrect assumption that the Doctrine's JSON object can only contain iterables. A string, boolean and a number is a perfectly valid JSON value the field supports. Whether or not it is weird to save a string as a JSON type is out of the scope of this bug report. The fact is that doing so possible, and so it should be handled, edge-case or not.
Current behavior
When auditing an entity holding a string in a
json
Doctrine property, Auditor passess the value to AuditTrait::deepDiff(), which has(?array, ?array)
signature.How to reproduce
Add a string property mapped as JSON column and trigger auditing.
Expected behavior
Auditor should survive a string stored in a JSON column.