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

CalendarVariable::calendar() returns false but expects CalendarModel or null #368

Open
danbrellis opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
investigating Currently investigating the report

Comments

@danbrellis
Copy link

Describe the bug or issue you're experiencing
Solspace\Calendar\Variables\CalendarVariable::calendar() is typed to return either an instance of CalendarModel or null. However, if $calendarService->getCalendars($attributes) returns an empty array, the reset() function will return false.

Steps to Reproduce
This was discovered while using Craft's 1st party plugin Feedme. See craftcms/feed-me#1583 (comment) for steps to reproduce.

Expected Behavior
Solspace\Calendar\Variables\CalendarVariable::calendar() should either be typed to include a return value of false OR convert the potential false value from reset() into null.

Craft & Plugin Info (please complete the following information):

  • Craft Version: 5.5.10
  • Calendar Version: 5.0.13
@danbrellis danbrellis added the issue Something isn't working correctly label Feb 6, 2025
@kjmartens kjmartens added investigating Currently investigating the report and removed issue Something isn't working correctly labels Feb 7, 2025
@kjmartens
Copy link
Contributor

Sorry about this @danbrellis,

We'll check into this shortly. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating Currently investigating the report
Development

No branches or pull requests

3 participants