Core serializer converts empty object to array on JSON schema which causes empty schemas objects to be incorrectly converted to an array therefore creating issues on pattern's schema.

Issue fork patternkit-3275342

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mariohernandez created an issue. See original summary.

mariohernandez’s picture

Title: Serializer converts empty to object to array » Serializer converts empty object to array
mariohernandez’s picture

Title: Serializer converts empty object to array » Core serializer converts empty object to array
bladwin’s picture

Replaced the two instances of core's serializationInterface from the block plugin and replaced with direct calls to `json_decode`. Additionally, removed the unused serializatoinInterface from the block plugin altogether.

mariohernandez’s picture

Status: Active » Needs review

bladwin’s picture

Adding TRUE to the config reset json_decode call so that empty objects are collapsed into arrays.

mariohernandez’s picture

mariohernandez’s picture

krisahil’s picture

I verified this change does not introduce new regressions into my site, though I cannot reproduce the original problem.

bladwin’s picture

Conferred with devs and it was decided to add the SerializationInterface back to the code, only replacing the one instance with a direct call to json_decode().

mariohernandez’s picture

Status: Needs review » Fixed
mariohernandez’s picture

Status: Fixed » Closed (fixed)