From e78bf010b0c1135c242c0686da8e5b7aaff2b8fa Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 13 Jul 2016 17:07:55 +1200 Subject: [PATCH] BUG Fix augmentWriteVersioned --- ORM/Versioning/Versioned.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ORM/Versioning/Versioned.php b/ORM/Versioning/Versioned.php index 33164ef9e..6d3f87f6c 100644 --- a/ORM/Versioning/Versioned.php +++ b/ORM/Versioning/Versioned.php @@ -774,7 +774,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider { // Set up a new entry in (table)_versions $newManipulation = array( "command" => "insert", - "fields" => isset($manipulation[$table]['fields']) ? $manipulation[$table]['fields'] : null, + "fields" => isset($manipulation[$table]['fields']) ? $manipulation[$table]['fields'] : [], "class" => $class, ); @@ -789,7 +789,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider { foreach ($data as $k => $v) { // If the value is not set at all in the manipulation currently, use the existing value from the database - if (is_array($newManipulation['fields']) && !array_key_exists($k, $newManipulation['fields'])) { + if (!array_key_exists($k, $newManipulation['fields'])) { $newManipulation['fields'][$k] = $v; } }