Stop storing the entity object in the entity reference selection settings

Created on 14 August 2025, 1 day ago

Problem/Motivation

Currently, the widget stores the entity object in the #selection_settings in order to pass it to the selection handler and use it there. This causes two issues:

  • The whole entity is serialized and stored in a row in the key_value table, with entity_autocomplete as collection. This takes up unnecessary storage.
  • For every different entity reference configuration, a new entity_autocomplete row is stored. Due to the dynamic nature of that entity object, a lot of (unnecessary) rows end up in the key_value table.

On a website where I'm using Tagify heavily this has resulted in a key_value table of 1.5 GiB.

Proposed resolution

Stop storing the entity in the selection settings.

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024