All pages included in the menu instead of just those starting with number

Previously (up to version 4.1.2) only the pages starting with numbers (e.g. 01_page, 02_another_page) were included in the main menu. After upgrading to version 4.2.0 all pages are listed in the menu. The menu.php has not changed and it is the same as in:

Is there any way to revert to the old behavior?

I’m missing some context, are you talking about the Starterkit? Or does $pages->listed() no longer return only listed pages, which would be a bug?

A fresh Starterkit seems to work as expected.

It is an old installation (updated many times) which I updated by replacing the kirby folder with the one from version 4.2.0. Fresh starterkit seems to work fine indeed, but there is no menu.php there. Reverting back the installation to 4.1.2 works fine too.

I don’t know enough php to debug it, but replacing
$items = $pages->listed();
in menu.php with hard coded list of pages fixed the issue.
My guess is that for some reason the behavior of that $pages->listed() has changed in 4.2.0 at least in certain conditions.

I don’t think so, that would be a breaking change and I tested $pages->listed in a Starterkit, which worked fine as well.

Maybe post the complete menu.php (it doesn’t matter what the file is called), so I can try and reproduce the problem.

The menu.php file is identical to the one from the Kirby Cookbook in the link my first post. I even replaced the menu.php file on my site with the Cookbook one to make sure that there is no some subtle difference but the problem still persists. After replacing

$items = $pages->listed();

with

$items = $site->pages()->filterBy(‘slug’, ‘in’, [‘page1’, ‘page2’, ‘page3’]);

and making no other changes whatsoever, the problem is fixed