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

[5.x]: Link fields ':notempty:' query param no longer works on Craft 5.5 #16113

Closed
mmikkel opened this issue Nov 14, 2024 · 2 comments
Closed
Assignees
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Nov 14, 2024

What happened?

Description

Since updating to Craft 5.5, element queries using :notempty: for Link field params no longer work as expected – i.e. a query like craft.entries.section('news').someLinkField(':notempty:').all() that would return entries with a value in a Link field someLinkField prior to 5.5, no longer returns any entries.

I tested this on Craft 5.4.10.1 as well, so it appears to be an unintended change in 5.5?

Steps to reproduce

  1. Create a Link field with the handle someLinkField (all settings at their defaults) and add it to an entry type's field layout
  2. Create an entry and give it a value for the Link field (I set the Link field type to "URL" and added a URL like https://www.example.com. Save the entry.
  3. Add the following query to a template:
{% set entries = craft.entries.someLinkField(':notempty:').all() %}
{% dd entries %}

Expected behavior

Passing :notempty: to a Link field query param should return entries with a value in that field.

Actual behavior

No entries are returned.

Craft CMS version

5.5.0.1

PHP version

8.2.24

Operating system and version

14.6.1 (DDEV v1.23.5)

Database type and version

MySQL 8.0.36

Image driver and version

No response

Installed plugins and versions

None

@mmikkel mmikkel added the bug label Nov 14, 2024
@i-just i-just self-assigned this Nov 14, 2024
@i-just
Copy link
Contributor

i-just commented Nov 15, 2024

Hi, thanks for reporting! If you need to get past that quickly, you can resave the elements that use the Link field. For example:
php craft resave/all --with-fields=someLinkField.

I will raise a PR for this shortly.

@brandonkelly
Copy link
Member

Craft 5.5.1 is out with a fix for this. Thanks again!

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

No branches or pull requests

3 participants