Issue : With Rainlab Translate plugin, blog slugs can be translated for multiple locales. When browsing the website with another locale than the default, if the slug is translated too, the Comments plugin is unable to find the blog post when posting a comment.
Fix : Didn't find the plugin repo on Github. So I post the fix here. The issue can be fixed by editing this file : /plugins/tallpro/blogcomments/components/Comments.php - Line 92.
Replace :
$post = PostModel::where('slug', '=', $blog_slug)->first();
By :
$post = new PostModel;
$post = ($post->isClassExtendedWith('RainLab.Translate.Behaviors.TranslatableModel')
? $post->transWhere('slug', $blog_slug)
: $post->where('slug', $blog_slug))->first();
Last updated