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

Entries list view and edit view loading all Taxonomy terms #10599

Open
danielwashbrook opened this issue Aug 8, 2024 · 2 comments
Open

Entries list view and edit view loading all Taxonomy terms #10599

danielwashbrook opened this issue Aug 8, 2024 · 2 comments

Comments

@danielwashbrook
Copy link

Bug description

After importing a large set of content that includes 19k Taxonomy Terms, the Entries list view and edit view becomes very slow as it loads all the terms as "Statamic\Eloquent\Taxonomies\TermModel" for the filters in the list view and the typeahead field selector on the edit view.
image
I currently see the following options to solve this:

  • Find a way to configure the list view filters in statamic - I didn't manage to find one yet
  • Look through statamic frontend or backend code to find a good spot to override one of the default implementations with an improved one

Thanks!

How to reproduce

Create a collection with a taxonomy term reference. Generate a large body of Terms for that taxonomy and create a few Entries of that collection type. Navigate to the list view of the Collection and subsequently the edit view of one of the entries.

Logs

No response

Environment

Environment
Application Name: Emmys
Laravel Version: 10.48.14
PHP Version: 8.2.19
Composer Version: 2.4.1
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 5
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.10.0 PRO

Statamic Addons
rias/statamic-redirect: 3.7.1
statamic/eloquent-driver: 4.5.0
statamic/seo-pro: 6.0.3
stefangalescu/statamic-heroicons: 3.0
thoughtco/statamic-blurhash: 1.2.0

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Taxonomies: file
Terms: eloquent
Tokens: eloquent

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@marcotesche
Copy link

To add to the description:

For the Edit Entry Page:
There are 2 workarounds to address performance issues when dealing with a large number of taxonomy terms:

  • Configure the blueprint to use the "Stack Selector" UI Mode for the taxonomy field. However, that might not be very convenient for certain taxonomies, like Tags.
  • Create a Query Scope with something like $query->limit(100) and configure the taxonomy field to use the "Typeahead Field" UI Mode in combination with that query scope.
    Perhaps limiting the search results could become the default behavior of the typeahead? Currently, with a large number of terms, the browser can be overwhelmed when trying to render all search results, especially if you type a common letter like "a".

For the Collection Entries List View:
Unfortunately, it seems there isn't a similar configuration option available for the Control Panel page listing all entries in a collection. That page always fetches all terms for all taxonomies associated with the collection to populate plain select fields for the filters.

@michaeljhopkins
Copy link

michaeljhopkins commented Aug 21, 2024

I was/am having similar issues. I detailed what I did and learned under this issue

statamic/eloquent-driver#344

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

4 participants