[Flow] The Definitive Guide Blog Data Not Sent To The Database

Richard Benson admin at sibkis.net
Mon Mar 24 19:09:11 CET 2014


Hello!

 All works well until the setup Controller: 
docs.typo3.org/flow/TYPO3FlowDocumentation/2.2/TheDefinitiveGuide/PartII/Controller.html

 When I call dev.tutorial.local/typo3.blog/setup/index I get "Successfully created a blog" as expected but the database remains empty. 
No error is thrown and debugging.
I have a database connection as all the "flow_doctrine_migrationstatus" etc is in my database so I know there is a connection
I have run ./flow doctrine:update as stated but when I view

dev.tutorial.local/typo3.blog/post

There are no posts.

So with no errors and no posts being sent to the database where to look?

the SetupController

<?php
namespace TYPO3\Blog\Controller;

/*                                                                        *
 * This script belongs to the TYPO3 Flow package "TYPO3.Blog".            *
 *                                                                        *
 *                                                                        */

use TYPO3\Flow\Annotations as Flow;

class SetupController extends \TYPO3\Flow\Mvc\Controller\ActionController {
 		/**
         * @Flow\Inject
         * @var \TYPO3\Blog\Domain\Repository\BlogRepository
         */
	protected $blogRepository;

	/**
    * @Flow\Inject
    * @var \TYPO3\Blog\Domain\Repository\PostRepository
    */
	protected $postRepository;

	/**
         * Sets up a fresh blog and creates a sample post.
         *
         * @return void
         */
	public function indexAction() {
		$this->blogRepository->removeAll();
        $this->postRepository->removeAll();

        $blog = new \TYPO3\Blog\Domain\Model\Blog();
        $blog->setTitle('My Blog');
        $blog->setDescription('A blog about B2B');
        $this->blogRepository->add($blog);

        $post = new \TYPO3\Blog\Domain\Model\Post();
        $post->setAuthor('Richard Benson');
        $post->setTitle('Start up Posts');
        $post->setContent('This is the Body Text for the blog posts Lorem ipsum dolor sit amet, 
        	consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        	Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
        	consequat');
        $this->postRepository->add($post);

        $blog->addPost($post);

        return 'Successfully created a blog';
	}

}

?>


 Kind Regards

Richard



More information about the Flow mailing list