Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive page demo appears to no longer work #3772

Closed
readtedium opened this issue Feb 1, 2019 · 2 comments
Closed

Archive page demo appears to no longer work #3772

readtedium opened this issue Feb 1, 2019 · 2 comments

Comments

@readtedium
Copy link

readtedium commented Feb 1, 2019

Description

With the most recent Craft update, my date logic stopped working correctly on my archive page—it was working previously. My setup is similar to the Craft guide for making an archive page though I pull in the year from a portion of my archive URL and have a set default that is not the current year.

The content does not appear at all on the archive page. Removing the before from the passage in entriesInYear makes the content appear again, but does not filter by year. Switching the current date to now.year as shown in the guide does not resolve the error.

My issue is explained in more detail on Stack Exchange: https://craftcms.stackexchange.com/questions/29349/archive-page-date-logic-stopped-working

Steps to reproduce

  1. Build archive page based on Craft guide
  2. Update to latest version of Craft

Additional info

  • Craft version: 3.17
  • PHP version: 7.2
@brandonkelly
Copy link
Member

Sorry about that, this has been fixed for the next release. The bug was that when you passed a year-only value to before() or after(), Craft was mistaking the value for a Unix timestamp.

To get the fix early. change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#404caffbf0cfcd2b70cee384904db0b9dc4ac465 as 3.1.7",
  "...": "..."
}

Then run composer update.

@readtedium
Copy link
Author

Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants