Database errors when enabling forms module

edited October 2015 in Modules
I've enabled the forms module on my develop-branch version of Fuel, and now when going to visit a blog author's page I get:

A PHP Error was encountered Severity: Notice Message: Undefined index: blog_comments Filename: models/blog_posts_model.php Line Number: 460 A Database Error Occurred Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'published` = 'yes'' at line 4 SELECT * FROM (`fuel_blog_comments`) WHERE `post_id` = 2 AND `.`published` = 'yes' Filename: \fuel\codeigniter\database\DB_driver.php Line Number: 331

line 460 is in get_comments_count and is $where = array('post_id' => $this->id, $this->_tables['blog_comments'].'.published' => 'yes');

Comments

  • edited 6:48PM
    Do you have the latest version of the blog from the develop branch?

    If so, if you change that line to:
    $where = array('post_id' => $this->id, $this->_parent_model->tables('blog_comments').'.published' => 'yes');
    Does it fix your issue?
  • edited October 2015
    Yep, I'm up to date with develop :/

    Yes this does fix it. I also had to make this change on all instances of _tables into _parent_model->tables() in the get_author function too.

    This also appears in get_comments, but I can go to a blog post page and still see the comments. Is there anything else I should look out for here too?

    Thanks!
  • edited October 2015
    Thank you.
Sign In or Register to comment.