Closed danystad closed 3 months ago
Hi guys, I am facing this problem after updating to version "5.0.6".
Craft Version: 4.11.1
Error:
Neither the property "events" nor one of the methods "events()", "getevents()"/"isevents()"/"hasevents()" or "__call()" exist and have public access in class "Solspace\Calendar\Library\Duration\DayDuration".
Code:
{% set events =
craft.calendar.events({
rangeStart: 'today',
rangeEnd: '+2 months',
calendar: siteCalendar,
limit: 3,
loadOccurrences: 'next'
})
%}
{% set groupedByDay = events.groupedByDay() %}
{% for day in groupedByDay %}
<li class="flex flex-col gap-2">
<span class="text-xs font-bold uppercase text-primary-700">
{{ day.startDate.format('D n/j') }}
</span>
{% for event in day.events %}
{% set eventUrl = event.url %}
{% if event.repeating %}
{% set eventUrl = eventUrl ~ '/' ~ event.startDate.format('Y-m-d')
%}
{% endif %}
<a href="{{ eventUrl }}" class="text-[15px] leading-[19px]">
{{ event.title }}
</a>
{% endfor %}
</li>
{% endfor %}
This should be resolved in Calendar 5.0.7 now. 🙂
Describe the bug or issue you're experiencing
Steps to reproduce
Craft & Plugin Info (please complete the following information):
Additional context
All 3 examples (for months, week, day) provided on the documentation page for Grouping Events by Month/Week/Day show a similar Twig Runtime Error.
Month:
Neither the property "events" nor one of the methods "events()", "getevents()"/"isevents()"/"hasevents()" or "__call()" exist and have public access in class "Solspace\Calendar\Library\Duration\MonthDuration".
Week:
Neither the property "events" nor one of the methods "events()", "getevents()"/"isevents()"/"hasevents()" or "__call()" exist and have public access in class "Solspace\Calendar\Library\Duration\WeekDuration".
Day:
Neither the property "events" nor one of the methods "events()", "getevents()"/"isevents()"/"hasevents()" or "__call()" exist and have public access in class "Solspace\Calendar\Library\Duration\DayDuration".