It looks like you're new here. If you want to get involved, click one of these buttons!
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
$where = array('post_id' => $this->id, $this->_tables['blog_comments'].'.published' => 'yes');
Comments
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?
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!
https://github.com/daylightstudio/FUEL-CMS-Blog-Module/commit/24c28c856397895017a4786b860688ea05047d08