mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Allow subclasses of ManyMany lists in EagerLoadedList (#10905)
This commit is contained in:
parent
c9f48089c9
commit
f345646481
@ -889,7 +889,7 @@ class EagerLoadedList extends ViewableData implements Relation, SS_List, Filtera
|
||||
*/
|
||||
public function getExtraData($componentName, int|string $itemID): array
|
||||
{
|
||||
if (!in_array(get_class($this->dataList), [ManyManyList::class, ManyManyThroughList::class])) {
|
||||
if (!($this->dataList instanceof ManyManyList) && !($this->dataList instanceof ManyManyThroughList)) {
|
||||
throw new BadMethodCallException('Cannot have extra fields on this list type');
|
||||
}
|
||||
|
||||
@ -926,7 +926,7 @@ class EagerLoadedList extends ViewableData implements Relation, SS_List, Filtera
|
||||
*/
|
||||
public function getExtraFields(): array
|
||||
{
|
||||
if (!in_array(get_class($this->dataList), [ManyManyList::class, ManyManyThroughList::class])) {
|
||||
if (!($this->dataList instanceof ManyManyList) && !($this->dataList instanceof ManyManyThroughList)) {
|
||||
throw new BadMethodCallException('Cannot have extra fields on this list type');
|
||||
}
|
||||
return $this->extraFields;
|
||||
|
Loading…
Reference in New Issue
Block a user