[FLOW3-general] problem while setting up the SetupController in blog tutorial

Streitferd Erika streitferd_erika at yahoo.com
Sun Dec 2 21:18:41 CET 2012


Hello!

Another issue I have met on blog tutorial.
I am trying to set up my SetupController , so I modified the Classes/Controller/SetupController.php like in the tutorial, but when I try to access the controller on this link: http://localhost/blog/Web/index.php/TYPO3.Blog/Setup I got an error: 

#42S22: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0_.title' in 'field list' (More information)

PDOException thrown in file
C:\xampp\htdocs\blog\Packages\Framework\Doctrine.DBAL\Classes\Connection.php in line 633.

Go to the FORGE issue tracker and report the issue - if you think it is a bug!
My \Classes\Domain\Model\Blog.php file looks like this:
class Blog {

    /**
     * The title
     * @var string
     * @FLOW3\Validate(type="Text")
     * @FLOW3\Validate(type="StringLength", options={ "minimum"=1, "maximum"=80 })
     * @ORM\Column(length=80)
     */
    protected $title;

    /**
     * The description
     * @var string
     * @FLOW3\Validate(type="Text")
     * @FLOW3\Validate(type="StringLength", options={ "maximum"=150 })
     * @ORM\Column(length=150)
     */
    protected $description;

    /**
     * The posts contained in this blog
     *
     * @var \Doctrine\Common\Collections\Collection<\TYPO3\Blog\Domain\Model\Post>
     * @ORM\OneToMany(mappedBy="blog")
     * @ORM\OrderBy({"date" = "DESC"})
     */
    protected $posts;
    
    public function __construct() {
        $this->posts = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Adds a post to this blog
     * 
     * @param \TYPO3\Blog\Domain\Model\Post $post
     * @return void
     */
    public function addPost(\TYPO3\Blog\Domain\Model\Post $post) {
        $post->setBlog($this);
        $this->posts->add($post);
    }
    
    /*
     * Removes a post from this blog
     *
     * @param \TYPO3\Blog\Domain\Model\Post $post
     * @return void
     */
    public function removePost(\TYPO3\Blog\Domain\Model\Post $post) {
        $this->posts->removeElement($post);
    }


    /**
     * Get the Blog's title
     *
     * @return string The Blog's title
     */
    public function getTitle() {
        return $this->title;
    }

    /**
     * Sets this Blog's title
     *
     * @param string $title The Blog's title
     * @return void
     */
    public function setTitle($title) {
        $this->title = $title;
    }

    /**
     * Get the Blog's description
     *
     * @return string The Blog's description
     */
    public function getDescription() {
        return $this->description;
    }

    /**
     * Sets this Blog's description
     *
     * @param string $description The Blog's description
     * @return void
     */
    public function setDescription($description) {
        $this->description = $description;
    }

    /**
     * Get the Blog's posts
     *
     * @return \Doctrine\Common\Collections\Collection The Blog's posts
     */
    public function getPosts() {
        return $this->posts;
    }

}

and my \Classes\Domain\Model\Post.php looks like this:
class Post {

    /**
     * The blog
     * @var \TYPO3\Blog\Domain\Model\Blog
     * @ORM\ManyToOne(inversedBy="posts")
     */
    protected $blog;

    /**
     * The title
     * @var string
     */
    protected $title;

    /**
     * The link title
     * @var string
     */
    protected $linkTitle;

    /**
     * The date
     * @var \DateTime
     */
    protected $date;

    /**
     * The author
     * @var string
     */
    protected $author;

    /**
     * The content
     * @var string
     * @ORM\Column(type="text")
     */
    protected $content;
    
    /*
     * Constructs this post
     */
    public function __construct() {
        $this->date = new \DateTime();
    }


    /**
     * Get the Post's blog
     *
     * @return \TYPO3\Blog\Domain\Model\Blog The Post's blog
     */
    public function getBlog() {
        return $this->blog;
    }

    /**
     * Sets this Post's blog
     *
     * @param \TYPO3\Blog\Domain\Model\Blog $blog The Post's blog
     * @return void
     */
    public function setBlog(\TYPO3\Blog\Domain\Model\Blog $blog) {
        $this->blog = $blog;
    }

    /**
     * Get the Post's title
     *
     * @return string The Post's title
     */
    public function getTitle() {
        return $this->title;
    }

    /**
     * Sets this Post's title
     *
     * @param string $title The Post's title
     * @return void
     */
    public function setTitle($title) {
        $this->title = $title;
        if ($this->linkTitle === '') {
                $this->linkTitle = strtolower(preg_replace('/[^a-zA-Z0-9\-]/', '', str_replace(' ', '-', $title)));
        }
    }

    /**
     * Get the Post's link title
     *
     * @return string The Post's link title
     */
    public function getLinkTitle() {
        if ($this->linkTitle === '') {
                $this->linkTitle = strtolower(preg_replace('/[^a-zA-Z0-9\-]/', '', str_replace(' ', '-', $this->title)));
        }
        return $this->linkTitle;
    }

    /**
     * Sets this Post's link title
     *
     * @param string $linkTitle The Post's link title
     * @return void
     */
    public function setLinkTitle($linkTitle) {
        $this->linkTitle = $linkTitle;
    }

    /**
     * Get the Post's date
     *
     * @return \DateTime The Post's date
     */
    public function getDate() {
        return $this->date;
    }

    /**
     * Sets this Post's date
     *
     * @param \DateTime $date The Post's date
     * @return void
     */
    public function setDate(\DateTime $date) {
        $this->date = $date;
    }

    /**
     * Get the Post's author
     *
     * @return string The Post's author
     */
    public function getAuthor() {
        return $this->author;
    }

    /**
     * Sets this Post's author
     *
     * @param string $author The Post's author
     * @return void
     */
    public function setAuthor($author) {
        $this->author = $author;
    }

    /**
     * Get the Post's content
     *
     * @return string The Post's content
     */
    public function getContent() {
        return $this->content;
    }

    /**
     * Sets this Post's content
     *
     * @param string $content The Post's content
     * @return void
     */
    public function setContent($content) {
        $this->content = $content;
    }

}

Thank you in advance for your help!
Cheers,
Erika


More information about the FLOW3-general mailing list