What am I missing?

I am new to PHP, so bare with me if I dont know what I am saying/asking. I updated the panel from 2.2.2 to 2.3 and my blog page stopped working. On Linux Centos 7 with php7 and Apache. I narrowed the problem down to the controller code, but I am a little lost. I could be wrong but the only problem i was not able to fix was myblog.com/blog. This the only page that spits errors out if I turn debugging on. Thank you.

Template blog.php code:

    <!DOCTYPE html>
    <?php
      snippet('open-html');
      snippet('head');
      snippet('open-body');
      snippet('open-app-wrap');
      snippet('header');
      snippet('open-app-body');
      snippet('primary-header');

      // Logic for posts, pagination and filters in /site/controllers/blog.php

      // Display filter message if filter, otherwise default page intro
      if ($filter):
        snippet('page-header-filtered-posts');
      else:
        snippet('page-intro');
      endif;

      // Display the short posts
      if ($posts->count() > 0):
        foreach ($posts as $post):
          snippet('post-short', array('post' => $post));
        endforeach;
      else:
        echo l('blog_no_posts_found');
      endif;

      // Display pagination
      if ($pagination->hasPages()):
        snippet('pagination', array('type' => 'blog', 'pagination' => $pagination));
      endif;

      snippet('close-app-body');
      snippet('footer');
      snippet('close-app-wrap');
      snippet('close-body');
      snippet('close-html');
    ?>

My controller code for blog.php:

<?php

return function($site, $pages, $page) {

  // Set default filter status
  $filter = false;

  // Get setting for number of posts per page
  $per_page = intval($site->blog_posts_per_page()->value());

  // Get sort order
  switch ($site->blog_sort_order()->value()) {
    case "chronological":
      $sort_field = 'date_published';
      $sort_dir = 'asc';
      break;
    case "reverse_chronological":
      $sort_field = 'date_published';
      $sort_dir = 'desc';
      break;
    case "alphabetical":
      $sort_field = 'title';
      $sort_dir = 'asc';
      break;
    case "reverse_alphabetical":
      $sort_field = 'title';
      $sort_dir = 'desc';
      break;
    default:
      $sort_field = 'date_published';
      $sort_dir = 'desc';
  }


  // Get all posts
  $posts = $page->children()->visible()->filter(function($child) {
    // Don't show posts with publish dates in the future
    return (time() - strtotime($child->date_published())) >= 0;
  });

  // Apply sorting if required
  if ($site->blog_sort_order()->value() != 'manual') {
    $posts = $posts->sortBy($sort_field, $sort_dir);
  }

  // Apply pagination
  $posts = $posts->paginate($per_page);


  // Author filter
  if ($by = param('by')):
    switch ($site->blog_author_name_display_style()):
      case 'full_name':
        $user = $site->users()->filter(function($user) {
          return $user->firstname() . ' ' . $user->lastname() == urldecode(param('by'));
        })->first();
        $username = isset($user) ? $user->username() : '';
        break;

      case 'first_name':
        $user = $site->users()->filter(function($user) {
          return $user->firstname() == urldecode(param('by'));
        })->first();
        $username = isset($user) ? $user->username() : '';
        break;

      default:
        $username = $by;
        break;
    endswitch;
    $posts = $posts->filterBy('author_username', urldecode($username));
    $filter = true;
  endif;


  // Date filter
  if ($date = param('from')):
    $posts = $posts->filterBy('date_published', urldecode($date));
    $filter = true;
  endif;


  // Tag filter
  if ($tag = param('tag')):
    $posts = $posts->filterBy('tags', urldecode($tag), ',');
    $filter = true;
  endif;

  // Type filter
  if ($type = param('type')):
    $posts = $posts->filter(function($child) {
      return $child->template() == urldecode('post-' . param('type'));
    });
    $filter = true;
  endif;


  // Create a shortcut for pagination
  $pagination = $posts->pagination();

  // Pass objects to the template
  return compact('posts', 'pagination', 'filter');

};

So what is the error you are getting? Please also post which file and line the error is in, that makes it a lot easier for us to spot the error.

PS: Please use Markdown code blocks when posting code in the forum. They use three backticks at the start and end on separate lines. I have corrected it for you above.

Thank you for your help.

When I turn debug on and go to /blog i get:

Fatal error: Uncaught Error: Call to a member function url() on boolean in /home/ideas1/webapps/parkwoodphp/kirby/kirby.php:301 Stack trace: #0 /home/ideas1/webapps/parkwoodphp/kirby/toolkit/helpers.php(270): Kirby->{closure}() #1 /home/ideas1/webapps/parkwoodphp/kirby/kirby.php(678): call(Object(Closure), Array) #2 /home/ideas1/webapps/parkwoodphp/index.php(16): Kirby->launch() #3 {main} thrown in /home/ideas1/webapps/parkwoodphp/kirby/kirby.php on line 301

I can’t see any method url() being used in the code snippets you provided above. It’s probably hidden in one of the snippets you are using?

I dont know enough about Kirby to diagnose this properly. Is there anything I can post or do to help diag this issue?

No, it’s ok, I missed something. Are you using another page then home as your start page?

Yes, I have this in my config file:
c::set(‘home’, ‘blog’);

You are using filters in your posts, so I assume the urls in those tags are not correct … we had the same issue here: Single blog entry: How to display its tags? (see last entry)