ProBlog

A powerful October CMS Blog plugin. Boost your SEO with robust blogging tools by Radiantweb.

Back to ProBlog Support

paulgrafx
paulgrafx

I started getting errors on certain queries using whereRaw.

Column not found: 1054 Unknown column 'radiantweb_blog_categories.id' in 'where clause' (SQL: select * from `octobercmsprefix_radiantweb_blog_categories` where exists (select 1 from `octobercmsprefix_radiantweb_blog_posts` where `octobercmsprefix_radiantweb_blog_posts`.`published` is not null and `published` = 1 and radiantweb_blog_categories.id = radiantweb_blog_posts.categories_id) order by `name` asc)")

The solution was to add the following 'DB::getTablePrefix()' but unsure if this is the correct solution.

->whereRaw('radiantweb_blog_categories.id = radiantweb_blog_posts.categories_id');

to

->whereRaw(DB::getTablePrefix().'radiantweb_blog_categories.id = '.DB::getTablePrefix().'radiantweb_blog_posts.categories_id');

It seems to relate to the 'tags' and 'categories' components only.

For now I have extended the plugin.

Last updated

1-1 of 1