studioespresso / craft-date-range

Date range field for Craft CMS
MIT License
12 stars 6 forks source link

Craft 5 - Invalid entryType specified #37

Closed helleholmsen closed 3 days ago

helleholmsen commented 3 weeks ago

Getting some error messages after updating to craft 5. For example this isnt working anymore:

{% set events = craft.entries.section('events').relatedTo(relatedTo).isFuture('dateFromTo').orderBy('dateFromTo asc').all() ?? [] %}

gives me: Invalid entryType specified

I tried with both {% set events = craft.entries.section('events').entryType('events').relatedTo(relatedTo).isFuture('dateFromTo').orderBy('dateFromTo asc').all() ?? [] %}

and

{% set events = craft.entries.section('events').type('events').relatedTo(relatedTo).isFuture('dateFromTo').orderBy('dateFromTo asc').all() ?? [] %}

janhenckens commented 3 days ago

Hey @helleholmsen

Since Craft 5, you need to add a second parameter to the isFutue() function, see the upgrade documentation here: https://github.com/studioespresso/craft-date-range?tab=readme-ov-file#upgrading-to-craft-5

Could you give that a try?