mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 05:09:06 +02:00
Resolve merge regressions
This commit is contained in:
parent
3b0a9f4ba2
commit
4f1f2497be
@ -122,7 +122,7 @@ class DBClassName extends Enum {
|
||||
return $class;
|
||||
}
|
||||
// If there is no class for this table, strip table modifiers (_Live / _versions) off the end
|
||||
if(preg_match('/^(?<class>.+)(_[^_]+)$/i', $this->getTable(), $matches)) {
|
||||
if(preg_match('/^(?<class>.+)(_[^_]+)$/i', $table, $matches)) {
|
||||
return $this->getClassNameFromTable($matches['class']);
|
||||
}
|
||||
|
||||
|
@ -1167,12 +1167,13 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
|
||||
$oldMode = Versioned::get_reading_mode();
|
||||
Versioned::reading_stage($toStage);
|
||||
|
||||
if(method_exists($conn, 'allowPrimaryKeyEditing')) {
|
||||
$conn = DB::get_conn();
|
||||
$conn->allowPrimaryKeyEditing($baseClass, true);
|
||||
// Migrate stage prior to write
|
||||
$from->setSourceQueryParam('Versioned.mode', 'stage');
|
||||
$from->setSourceQueryParam('Versioned.stage', $toStage);
|
||||
|
||||
$conn = DB::get_conn();
|
||||
if(method_exists($conn, 'allowPrimaryKeyEditing')) {
|
||||
$conn->allowPrimaryKeyEditing($baseClass, true);
|
||||
$from->write();
|
||||
$conn->allowPrimaryKeyEditing($baseClass, false);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user