[TYPO3-english] Simple Blog extension - addAction issue

Andreea Ciuprina andreea.c1110 at gmail.com
Mon Sep 26 22:07:30 CEST 2016


Hello!

I have been following and re-implementing the Simple Blog extension from Patrick Lobacher's & Michael Schams TYPO3 Extbase book (described starting with chapter 5). When implementing the action methods (exactly as described in chapter 7), I got the following error:

Argument 1 passed to Lobacher\Simpleblog\Controller\BlogController::addAction() must be an instance of Lobacher\Simpleblog\Domain\Model\Blog, none given

Indeed, the $blog variable with which the addAction() method is called, has the value NULL, even though it should be defined in the form AddForm.html (as explained in the book). 

I have managed to solve the problem by changing the name of the action from add to addBlog -- then I get no more errors and I am able to create a new blog entry. 
So could this be just a naming issue, the addAction method could conflict with the add() method of the blogRepository? According to the book, this is not the expected behaviour. 
It would be great if someone could explain me what the problem is.

Thank you!


More information about the TYPO3-english mailing list