Url field decoding before insert

Created on 3 April 2023, about 1 year ago

Problem/Motivation

when log for an encoded Url with more than 255 characters caused the following error in the database

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'url' at row 1: INSERT INTO "counter" ("ip", "created", "url", "uid", "nid", "type", "browser_name", "browser_version", "platform") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 1680509434 [:db_insert_placeholder_2] => /ar/%D8%A7%D9%84%D9%85%D8%AC%D9%84%D8%A9-%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9-%D9%84%D9%86%D8%B8%D9%85-%D8%A7%D9%84%D9%85%D8%B9%D9%84%D9%88%D9%85%D8%A7%D8%AA-%D8%A7%D9%84%D8%AC%D8%BA%D8%B1%D8%A7%D9%81%D9%8A%D8%A9/%D8%A7%D8%B1%D8%B4%D9%8A%D9%81-%D8%A7%D9%84%D8%A7%D8%B9%D8%AF%D8%A7%D8%AF/%D8%A7%D9%84%D9%85%D8%AC%D9%84%D8%AF9-%D8%A7%D9%84%D8%B9%D8%AF%D8%AF1 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 3164 [:db_insert_placeholder_5] => page [:db_insert_placeholder_6] => Unknown [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => Unknown ) in Drupal\counter\CounterUtility->insertCounterData() (line 118 of /home/www/subsites/web/modules/contrib/counter/src/CounterUtility.php).

Steps to reproduce

Proposed resolution

decode the URL before the inserting step.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡¬Egypt Mok7tar Egypt , Mansoura

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

Comments & Activities

Production build 0.69.0 2024