FIX forward IDs given by DataList::relation()

This way calling `->relation('BlogPosts')` does not return an UnsavedRelationList

fixes #619
This commit is contained in:
wernerkrauss 2020-08-10 16:35:06 +02:00 committed by Werner M. Krauß
parent 92eb4f5da0
commit 31a3c3e7d1

View File

@ -20,11 +20,12 @@ use SilverStripe\View\Parsers\URLSegmentFilter;
trait BlogObject
{
/**
* @param int|array|null $id Optional ID(s) for parent of this relation, if not the current record
* @return DataList
*/
public function BlogPosts()
public function BlogPosts($id = null)
{
$blogPosts = parent::BlogPosts();
$blogPosts = parent::BlogPosts($id);
$this->extend('updateGetBlogPosts', $blogPosts);