Merge pull request #4827 from SilbinaryWolf/fix-fieldLabels-abstract-class-bug

Fixed bug where inheriting an abstract class broke scaffoldFormFields / fieldLabels(true)
This commit is contained in:
Damian Mooyman 2015-12-22 16:42:54 +13:00
commit 959c84cf6f

View File

@ -3631,10 +3631,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
'db' => (array)Config::inst()->get($ancestorClass, 'db', Config::UNINHERITED)
);
if($includerelations){
$types['has_one'] = (array)singleton($ancestorClass)->uninherited('has_one', true);
$types['has_many'] = (array)singleton($ancestorClass)->uninherited('has_many', true);
$types['many_many'] = (array)singleton($ancestorClass)->uninherited('many_many', true);
$types['belongs_many_many'] = (array)singleton($ancestorClass)->uninherited('belongs_many_many', true);
$types['has_one'] = (array)Config::inst()->get($ancestorClass, 'has_one', Config::UNINHERITED);
$types['has_many'] = (array)Config::inst()->get($ancestorClass, 'has_many', Config::UNINHERITED);
$types['many_many'] = (array)Config::inst()->get($ancestorClass, 'many_many', Config::UNINHERITED);
$types['belongs_many_many'] = (array)Config::inst()->get($ancestorClass, 'belongs_many_many', Config::UNINHERITED);
}
foreach($types as $type => $attrs) {
foreach($attrs as $name => $spec) {