mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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
|
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');
|
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
|
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');
|
throw new BadMethodCallException('Cannot have extra fields on this list type');
|
||||||
}
|
}
|
||||||
return $this->extraFields;
|
return $this->extraFields;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user