FIXED: Crash during dev/build on new database construction

This commit is contained in:
Damian Mooyman 2012-08-21 10:14:22 +12:00 committed by Ingo Schommer
parent ba62557aac
commit 1120f2974e

View File

@ -1144,12 +1144,12 @@ class Translatable extends DataExtension implements PermissionProvider {
*/
protected function populateSiteConfig() {
// Work-around for population of defaults during test setup (when tables are not created).
// When the database is being setup during testing, singleton('SiteConfig') is called.
// Work-around for population of defaults during database initialisation
// When the database is being setup singleton('SiteConfig') is called.
// Singleton objects should not call populateDefault() but a bug seems to be allowing it
// to happen anyway. Looking up existing SiteConfig objects without a database crashes horribly
// @todo Remove this hack once this bug is fixed
if(SapphireTest::using_temp_db() && !DB::getConn()->hasTable($this->owner->class))
if(!DB::getConn()->hasTable($this->owner->class))
return;
// Find the best base translation for site config