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

Use whereJsonContains #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use whereJsonContains #92

wants to merge 1 commit into from

Conversation

Jade-GG
Copy link
Contributor

@Jade-GG Jade-GG commented Dec 5, 2024

The linked_product and linked_category fields are a "Belongs To" field which is one of those fields that always has max_items:1. Normally, when you would save an entry, this field would just return the number, like so:

{
    ...
    linked_category:92
    ...
}

However, since a semi-recent update of runway, if you save the blueprint, it will silently remove "max_items:1" from the field, and you end up getting this:

{
    ...
    linked_category:[92]
    ...
}

This is sort of a bug, or at least an unintended side effect of some update.


This is a backwards-compatible way to make sure this update doesn't break your links. Whether or not this is the ideal solution, I'm not sure. Ideally this bug should just get fixed of course 🙂

Copy link
Member

@kevinmeijer97 kevinmeijer97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally i'd like to see an actual fix for the max_items setting in Runway.
But this change would support both linked_category:92 & linked_category:[92] formats so it's fine with me either way.

@royduin
Copy link
Member

royduin commented Dec 6, 2024

Let's see where statamic-rad-pack/runway#640 goes

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

Successfully merging this pull request may close these issues.

4 participants