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

[4.x]: Date field condition ':notempty:' throws error #12457

Closed
nilsenpaul opened this issue Dec 14, 2022 · 3 comments
Closed

[4.x]: Date field condition ':notempty:' throws error #12457

nilsenpaul opened this issue Dec 14, 2022 · 3 comments
Assignees

Comments

@nilsenpaul
Copy link
Contributor

What happened?

Description

In a custom element source, with the condition of a date field set to 'empty' or 'not empty', an error gets thrown:

craft\fields\conditions\DateFieldConditionRule::elementQueryParam(): Return value must be of type ?array, string returned

Steps to reproduce

  1. Create a custom element source on an element with a date field
  2. Set a condition 'not empty' or 'empty' on the date field
  3. Try to load the element index. It doesn't work (for me)

elementQueryParam must return null or an array, but it gets its input from BaseDateRangeConditionRule, which returns a string if 'empty' or 'not empty' was requested.

Craft CMS version

4.3.4

PHP version

8.1

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@i-just
Copy link
Contributor

i-just commented Dec 15, 2022

Thanks for reporting! I created a PR to fix this.

@i-just i-just self-assigned this Dec 15, 2022
@brandonkelly
Copy link
Member

This is fixed for the next release via #12461.

@brandonkelly
Copy link
Member

Craft 4.3.6 is out with the fix for this.

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

No branches or pull requests

3 participants