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] Entries Fieldtype: Hide tree view when using query scopes #11484

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

duncanmcclean
Copy link
Member

Currently, when you specify one or more query_scopes on the Entries Fieldtype, you'll see the scoped entries in the "List" view, but you'll see unscoped entries in the "Tree view".

Since the tree view isn't really built to be filtered, this pull request ensures it's hidden when a query scope is being used.

Closes #11477.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

I think it's probably better to leave the canUseTree as a computed, and instead avoid passing a tree prop if there are query scopes.

@jasonvarga jasonvarga dismissed their stale review February 21, 2025 15:01

Changes made

@jasonvarga jasonvarga merged commit 9142ed6 into 5.x Feb 21, 2025
17 checks passed
@jasonvarga jasonvarga deleted the hide-tree-view-when-using-a-query-scope branch February 21, 2025 15:02
@jensolafkoch
Copy link

jensolafkoch commented Feb 22, 2025

After updating to 5.48.0 I still see the tree view for fields with query scopes. Restarted everything, cleared cache etc.

Do I miss something?

@duncanmcclean
Copy link
Member Author

duncanmcclean commented Feb 24, 2025

That's strange... the fix is working for me 🤔

CleanShot.2025-02-24.at.10.07.53.mp4

Are you definitely on 5.48.0? Also, can you run php artisan statamic:install to make sure you have the latest JS?

@jensolafkoch
Copy link

Ah, okay, it was the missing JS!

I had just installed 5.48.0, and thought that would suffice. I believe I had restarted the whole dev environment incl. server and browser afterward, but maybe I missed something. Thanks, also for fixing it! :-)

@jasonvarga
Copy link
Member

The statamic:install command gets run automatically when you composer update. Not sure what happened for you but glad to know it's working now 😄

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.

Scope for an Entry field is only applied in List View, not in Tree View
3 participants