Edit: This is confirmed as a bug in Craft, that will be fixed in its next release. If you're running into this, please see the temporary fix over at GitHub: https://github.com/craftcms/cms/issues/3772
I'm leaving up the original post for posterity.
--
I'm running into an issue with the recent update for Craft 3.1. I've not changed any of my code on the archive pages, but the list of entries on my archive pages stopped showing up.
Here is the code I use to set up the date ordering.
{% set firstEntryEver = craft.entries.section('posts').orderBy('postDate asc').one() %}
{% set lastEntryEver = craft.entries.section('posts').orderBy('postDate desc').one() %}
{% if craft.app.request.getSegment(2) is null %}
{% set year = 2018 %}
{% else %}
{% set year = craft.app.request.getSegment(2) %}
{% endif %}
{% set archiveBlurbs = craft.entries.section('archives').type('yearBlurb').archiveYear(year) %}
{% set monthBlurbs = craft.entries.section('archives').type('monthBlurb').archiveYear(year) %}
{% set entriesInYear = craft.entries.section('posts').limit(null).after(year).before(year+1).all() %}
And the call I use is {% for month, entriesInMonth in entriesInYear | group("postDate|date('F')") %}
. The content is then separated by month over a single year.
The logic I use here generally follows the official docs with some light modifications. I find that the content for all years shows up if I remove the before
.
Any idea what might be at play here?