View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0024056 | mantisbt | custom fields | public | 2018-02-28 17:59 | 2023-04-12 13:25 |
Reporter | TiKu | Assigned To | atrol | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.11.0 | ||||
Target Version | 2.13.0 | Fixed in Version | 2.13.0 | ||
Summary | 0024056: Custom Fields of type "Textarea" cannot contain more than 255 chars due to bug_history table | ||||
Description | I have a custom field of type 10 (textarea) that is meant to contain more than 255 characters. If I report an issue and enter more than 255 characters, I run into an SQL error because Mantis tries to write the field's whole content to the bug_history table's new_value field, which is defined as varchar(255). It would be okay to cut the value for the history at 255 characters. | ||||
Tags | No tags attached. | ||||
related to | 0010923 | closed | vboctor | function history_log_event_direct should check (and eventually truncate) the length of the new and the old value |
related to | 0025002 | closed | atrol | Error when updating content in a custom field of type "Text Area" ("Textbereich"): History cannot be stored |
related to | 0032385 | closed | dregad | Incorrect use of mb_strimwidth() to truncate old/new values in history API |
|
|
For my scenario solution 1 would be sufficient. Solution 3 could break plugins that access those fields in SQL queries. I don't consider this very common though. |
|
I think (1) is good enough for now. Regarding (3), instead of going for a specific functionality for custom fields, i'd rather propose an extension of history table itself, having change header and detail in separated tables (for long texts as a start) Having long texts can be a performance hit when reading multiple rows cointaining that field when it may not actually be needed. As found in Oracle, where they are CLOB fields that need a separate query for retrieving each individual clob value (which is done under the hood by adodb) |
|
MantisBT: master 339cf883 2018-03-01 02:53 Details Diff |
Truncate values before writing to database history table TEXTAREA custom fields can contain more than 255 characters. Changing such fields fails, as the new value can't be stored in history table. This change fixes the issue by truncating the string. See 0024056 for other options to fix it. Fixes 0024056 |
Affected Issues 0024056 |
|
mod - core/constant_inc.php | Diff File | ||
mod - core/history_api.php | Diff File |