mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
BUG Do not populate defaults when updating schema.
This breaks the dev/build if the table is not ready or has been modified. The default record will be created later anyway.
This commit is contained in:
parent
c0aad11170
commit
8acc5c4851
@ -1193,10 +1193,10 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
*/
|
||||
protected function populateSiteConfigDefaults() {
|
||||
|
||||
// Work-around for population of defaults during database initialisation.
|
||||
// When the database is being setup singleton('SiteConfig') is called.
|
||||
if(!DB::getConn()->hasTable($this->owner->class)) return;
|
||||
if(!DB::getConn()->hasField($this->owner->class, 'Locale')) return;
|
||||
// When the database is being setup singleton('SiteConfig') is called,
|
||||
// but the SiteConfig table might not be ready yet and the queries will break.
|
||||
// Skip the population of defaults in this case.
|
||||
if(DB::getConn()->isSchemaUpdating()) return;
|
||||
|
||||
// Find the best base translation for SiteConfig
|
||||
Translatable::disable_locale_filter();
|
||||
|
Loading…
Reference in New Issue
Block a user