Issue when chronological sorting by date field

Hullo,

I have a page blueprint post.yml that includes a date field. In that blueprint I have the num parameter set up to sort the pages chronologically.

This has always worked fine, but I’ve just tried adding a new post and I get this error when changing the status to Public:

Kirby\Cms\App::extendRoutes(): Argument #1 ($routes) must be of type Closure|array, bool given, called in /REDACTED/kirby/src/Cms/AppPlugins.php on line 106

My post.yml blueprint:

title: Post Page
num: '{{ page.date.toDate("Ymd") }}'

fields:
  date:
    label: Post Date
    type: date
    default: now
    required: true
    time:
      notation: 12

Based on the example here: Page blueprint | Kirby CMS

As mentioned, this setup has always worked fine for me and matches the docs linked above. I have updated Kirby (currently on 4.2.0) since the last time I added a post. I can save the post as Unlisted without error. Commenting out the num: line allows me to save the post as Public.

Appreciate the help!

Hm, but the error message points to some route in a plugin. Which plugins are you using? When you updated Kirby, did you also update all plugins or check if the ones you are using are compatible with your Kirby version?

1 Like

Aha! I didn’t update a plugin, but I did move routes from the config.php to a standalone file and somewhere in that process I messed it up. Moving the routes back into the config.php file sorted out the problem.

Thanks for pointing me in the right direction – I’ll look into what I had wrong in my setup, i.e.

// CUSTOM ROUTES
'routes' => require_once __DIR__ . '/routes.php',

But that can wait for another day! Thanks again :smile: