Limit on synonym character length

Created on 20 December 2024, 4 months ago

Problem/Motivation

Input field for synonyms is limited to 1024 characters.
Import fails if a synonym length exceeds maximum allowed with the following error.

Steps to reproduce

Unable to add long string of synonyms to synoynm field when making a new entry. unable to import list with synonym of longer allowed length.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'synonyms' at row 1: UPDATE "search_api_synonym" SET "uuid"=:db_update_placeholder_0, "langcode"=:db_update_placeholder_1, "uid"=:db_update_placeholder_2, "type"=:db_update_placeholder_3, "word"=:db_update_placeholder_4, "synonyms"=:db_update_placeholder_5, "status"=:db_update_placeholder_6, "created"=:db_update_placeholder_7, "changed"=:db_update_placeholder_8 WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => number [:db_update_placeholder_1] => en [:db_update_placeholder_2] => 1 [:db_update_placeholder_3] => synonym [:db_update_placeholder_4] => {synonym} [:db_update_placeholder_5] => {Long string synonyms causing error} [:db_update_placeholder_6] => 1 [:db_update_placeholder_7] => 1734707112 [:db_update_placeholder_8] => 1734708093 [:db_condition_placeholder_0] => 28 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Proposed resolution

Synonym is stored as plain text field.

Recommend changing field to text plain long and update related code/ui.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024