Data too long for column 'name' error when exporting as anonymous user

Created on 5 January 2022, almost 3 years ago
Updated 20 July 2023, over 1 year ago

Problem/Motivation

Anonymous user error when export to excel
-------------------------- Drupal Error Start
Message Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1: INSERT INTO {key_value_expire} ("name", "collection", "value", "expire") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => lQHjleacEH80QMcnFbL4V1QmOiL-7uaknwqIvnp6A70:stakeholders:page_3:vbo_export_generate_xlsx_action:4bb922dd89e637c9f6fcc55c87f16b7b:1 [:db_insert_placeholder_1] => tempstore.private.vbo_export_multiple [:db_insert_placeholder_2] => O:8:"stdClass":3:{s:5:"owner";s:43:"lQHjleacEH80QMcnFbL4V1QmOiL-7uaknwqIvnp6A70";s:4:"data";a:10:{i:0;a:9:{s:16:"field_first_name";s:368:"
--------------------------------------------------------

Steps to reproduce

Create a view, and add field Global: Views bulk operations
in Configure field: Global: Views bulk operations :
- Generate xlsx from selected view results
- Strip HTML tags
- Override the fields configuration
Access: Unrestricted

All work perfect if the user logged-in only not Anonymous user "no user logged-in"

Proposed resolution

The string generated during the operation is long than the length for core table key_value_expire column name type varchar Length 128 - if this changed to 256 the export operation for Anonymous user will work. But this is not the perfect solution to alter a core storage (Thought: the generated string need to be max length of 128 char to march the core structure of key_value_expire table

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

🇨🇦Canada Nasr2000 Ottawa

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.

Production build 0.71.5 2024