Setting a non-empty associative array as the default value for a field of type TYPE_SERIALIZED (or TYPE_JSON) in a DataWriter will result in an error caused by an attempted read on index 0.
Steps to reproduce the issue:
- Add a field to a new or existing DataWriter, with TYPE_SERIALIZED.
- Assign the default value of the field to a non-empty associative array.
// Given fields is the array return by _getFields() $fields['my_field'] = array( 'type' => self::TYPE_SERIALIZED, 'default' => array( 'foo' => 'bar' ) );
Undefined offset: 0 - library\XenForo\DataWriter.php:1681