So, I’ve got this in my controller for a template:
$letters = $pages->find('letters')->children()->filterBy('date', '<=', time());
date
is a metadata field that contains a date to publish the page (e.g. 2015-11-25
). In this way, I could schedule pages to publish in the future.
In past versions of Kirby, $letters
would correctly return a collection that excluded pages with a date
field that was set in the future. However, with Kirby 2.2, it no longer excludes those pages — the collection returned includes every single page, regardless of what I have in the date
field.
Nothing else has changed on my end except for the update to 2.2. Also, filterBy()
seems to work properly for filtering with a string. It’s just when I’m filtering against time()
that it malfunctions.