Skip to content

Commit fc7a623

Browse files
committed
Allow array field value from method
1 parent 8b878c7 commit fc7a623

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/DataObject/DataObjectDocument.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use SilverStripe\Forager\Service\PageCrawler;
3232
use SilverStripe\Forager\Service\Traits\ConfigurationAware;
3333
use SilverStripe\Forager\Service\Traits\ServiceAware;
34+
use SilverStripe\Model\List\SS_List;
3435
use SilverStripe\Model\ModelData;
3536
use SilverStripe\ORM\DataList;
3637
use SilverStripe\ORM\DataObject;
@@ -715,6 +716,10 @@ private function parsePath(array $path, mixed $context = null): ?array
715716
}
716717
}
717718

719+
if ($subject instanceof SS_List) {
720+
return [$subject, $subject->toArray()];
721+
}
722+
718723
throw new LogicException(sprintf(
719724
'Cannot resolve field %s on list of class %s',
720725
$nextField,

0 commit comments

Comments
 (0)