Problem with the Part II: Getting Started tutorial / Flow 5.3

Hello everybody,

hope it’s the right place for my question.

I tried to walk through the tutorial witch can be found here:
https://flowframework.readthedocs.io/en/5.3/TheDefinitiveGuide/PartII/index.html

Everything went fine so far, but there is one thing that don’t work. When I try to create a new Blogpost I become this Error:

Argument 1 passed to Acme\Blog\Domain\Model\Post_Original::setBlog() must be an instance of Acme\Blog\Domain\Model\Blog, null given, called in /www/htdocs/***/***/***/blog/Packages/Libraries/neos/utility-objecthandling/Classes/ObjectAccess.php on line 259

I hope that someone could help me out with this issue.

Thanks in advance

Greetings

Just for reference this has been solved in our slack in this thread together with Kilian:
https://neos-project.slack.com/archives/C050C8FEK/p1582138877122800

The essential part is adding this to the controller

/**
 * @param ViewInterface $view
 * @return void
 */
protected function initializeView(ViewInterface $view) {
    $blog = $this->blogRepository->findActive();
    $this->view->assign('blog', $blog);
}

(And making sure that you add a use statement for the ViewInterface)

1 Like