Back to ProBlog Support

paulgrafx
paulgrafx

Hi,

I seem to keep bringing this up after every update and it still isn't done or no solution is given. Unknown categories and tags urls are appearing as 500's instead of 404's.

So for example:

  1. /tag/name-exists I get the page.
  2. /tag/name-wrong I get 500 instead of 404

Here is how I keep having to solve it every update:

'components/BlogList.php' starting at line 263 -> 'return $this->controller->run('404');'

if ($this->property('filter_type') == 'category'){
    $category_name = $this->property('filter_value');
    $category = CategoryModel::where('slug', '=', $category_name)->first();
    if($category){
        $catID = $category->id;
    }else{
        $catID = '#';
    return $this->controller->run('404');
    }
    $BlogPosts->filterByCategory($catID);
}

if ($this->property('filter_type') == 'tag'){
    $tag = TagModel::where('slug', '=', $this->property('filter_value'))->first();
    if($tag){
        return $tag->posts()->paginate($this->property('postsPerPage'));
        } else {
        return $this->controller->run('404');
    }
}

If it helps I get this error message in the system.

Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function posts() on null in /plugins/radiantweb/problog/components/Bloglist.php:276

Could I use an Event::listen to completely replace the protected function?

Last updated

ChadStrat
ChadStrat

I'll dig into this and see what I can come up with. Thanks for pointing this out.

ChadStrat
ChadStrat

next update has this change.

paulgrafx

1-4 of 4