omdreamreg6295
omdreamreg6295

I use database prefix "oct_"


protected function loadCategories()
    {
        $categories = BlogCategory::orderBy('name');
        if (!$this->property('displayEmpty')) {
            $categories->whereExists(function($query) {
                $query->select(Db::raw(1))
                ->from('rainlab_blog_posts_categories')
                ->join('rainlab_blog_posts', 'rainlab_blog_posts.id', '=', 'rainlab_blog_posts_categories.post_id')
                ->whereNotNull('rainlab_blog_posts.published')
                ->where('rainlab_blog_posts.published', '=', 1)
                ->whereRaw('rainlab_blog_categories.id = rainlab_blog_posts_categories.category_id');
            });
        }
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'rainlab_blog_categories.id' in 'where clause' (SQL: select * from `oct_rainlab_blog_categories` where exists (select 1 from `oct_rainlab_blog_posts_categories` inner join `oct_rainlab_blog_posts` on `oct_rainlab_blog_posts`.`id` = `oct_rainlab_blog_posts_categories`.`post_id` where `oct_rainlab_blog_posts`.`published` is not null and `oct_rainlab_blog_posts`.`published` = 1 and rainlab_blog_categories.id = rainlab_blog_posts_categories.category_id) order by `nest_left` asc, `name` asc)

Last updated

KurtJensen
KurtJensen

This is probably a bug in Rainlab.Blog. I will report it to the authors.

See: https://github.com/rainlab/blog-plugin/pull/198

omdreamreg6295

1-3 of 3