robwilkerson / CakePHP-Audit-Log-Plugin

Records changes made to an object during CRUD operations.
104 stars 78 forks source link

JSON encode values, if they are arrays #81

Closed ravage84 closed 7 years ago

ravage84 commented 8 years ago

Consider integrating this change: https://github.com/benrasmusen/CakePHP-Audit-Log-Plugin/commit/66022f1484797418346b77a7ceff739c16b0a3bf

Not sure in what situation this can happen, though. I think, it can only happen with virtual fields.

Are they processed anyway? Should they be processed at all?

ravage84 commented 8 years ago

Apparently, virtual fields are not saved:

https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin/blob/c69e83c2929d2f4896f34e9d12743f0e701de07f/Model/Behavior/AuditableBehavior.php#L180-L183

ravage84 commented 7 years ago

@benrasmusen could you please explain me your change in https://github.com/benrasmusen/CakePHP-Audit-Log-Plugin/commit/66022f1484797418346b77a7ceff739c16b0a3bf

benrasmusen commented 7 years ago

@ravage84 That was 4 years ago, so I don't remember the context of the change, but I assume I was getting back arrays and wanted a way to save that array as a string in the database. Not sure if that answers your question.

ravage84 commented 7 years ago

@benrasmusen to some extend. Thanks for trying :smirk_cat:

@steampilot wanna help to contribue?

ravage84 commented 7 years ago

YAGNI. Until somebody comes up with this problem again, I would not implement it.