General developer forum

other event data must be compatible with json encoding

 
Renaat
Re: other event data must be compatible with json encoding
Core developersParticularly helpful MoodlersPlugin developers
You can find the string "other event data must be compatible with json encoding" and a reason in the file lib/classes/event/base.php :

 protected final function validate_before_trigger() {
...

if ($CFG->debugdeveloper) {
...
$encoded = json_encode($this->data['other']);
// The comparison here is not set to strict as whole float numbers will be converted to integers through JSON encoding /
// decoding and send an unwanted debugging message.
if ($encoded === false or $this->data['other'] != json_decode($encoded, true)) {
debugging('other event data must be compatible with json encoding', DEBUG_DEVELOPER);
}


 
Average of ratings: -