mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Updated DataObject::buildSQL() to use DB::getConn() to check to see if a DB connection has been intialised rather than ManifestBuilder::has_been_included().
This commit is contained in:
parent
825242eba1
commit
9caf597aee
@ -2605,8 +2605,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
// Get the tables to join to
|
||||
$tableClasses = ClassInfo::dataClassesFor($this->class);
|
||||
if(!$tableClasses) {
|
||||
if(!ManifestBuilder::has_been_included()) {
|
||||
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not querying the database in _config.php.", E_USER_ERROR);
|
||||
if (!DB::getConn()) {
|
||||
throw new Exception('DataObjects have been requested before'
|
||||
. ' a DB connection has been made. Please ensure you'
|
||||
. ' are not querying the database in _config.php.');
|
||||
} else {
|
||||
user_error("DataObject::buildSQL: Can't find data classes (classes linked to tables) for $this->class. Please ensure you run dev/build after creating a new DataObject.", E_USER_ERROR);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user