mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Fix augmentWriteVersioned
This commit is contained in:
parent
6d835a64ad
commit
e78bf010b0
@ -774,7 +774,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
|
|||||||
// Set up a new entry in (table)_versions
|
// Set up a new entry in (table)_versions
|
||||||
$newManipulation = array(
|
$newManipulation = array(
|
||||||
"command" => "insert",
|
"command" => "insert",
|
||||||
"fields" => isset($manipulation[$table]['fields']) ? $manipulation[$table]['fields'] : null,
|
"fields" => isset($manipulation[$table]['fields']) ? $manipulation[$table]['fields'] : [],
|
||||||
"class" => $class,
|
"class" => $class,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -789,7 +789,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
|
|||||||
|
|
||||||
foreach ($data as $k => $v) {
|
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 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;
|
$newManipulation['fields'][$k] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user