view edit page not loading / memory leak on "not empty" not exposed filter

Created on 3 October 2022, over 2 years ago
Updated 20 October 2023, over 1 year ago

Problem/Motivation

A view edit page was not loading due to memory issues.
One of its filters was over an entity reference field, not exposed, with a "not empty" operator.
Users with access to the view UI could not edit the view.
The mentioned filter was loading more than 45k media entities, exhausting the memory.

Steps to reproduce

- Create a view
- Create a non-exposed filter over an entity reference field
- In the operator, select "not empty."
- Save the view.
- Increase the number of potential referenced entities on the filter and refresh the view edit form for that view.
- Control the memory usage (xhprof) and notice the memory for the same view increases while you keep adding entities, or keep adding entities until the memory limit is surpassed.

Proposed resolution

Avoid loading `valueOptions` (entities) on Drupal\views\Plugin\views\filter\InOperator if the operator is "empty" or "not empty".

πŸ› Bug report
Status

Needs work

Version

9.5

Component
ViewsΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ͺπŸ‡¨Ecuador betoaveiga Daule, Guayas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France 5

    Just a modification to make the problem explicit in the title so that others metting this problem may identify it better.

Production build 0.71.5 2024