View Issue Details

IDProjectCategoryView StatusLast Update
0025002mantisbtcustom fieldspublic2023-04-12 13:25
Reporterrschmidt_333 Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.17.1 
Target Version2.19.0Fixed in Version2.19.0 
Summary0025002: Error when updating content in a custom field of type "Text Area" ("Textbereich"): History cannot be stored
Description

While updating the text within a custom field of type "Text Area", we get the error Message:
"APPLICATION ERROR 0000401
Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet #1406: Data too long for column 'old_value' at row 1 für die Abfrage: INSERT INTO mantis_bug_history_table
( user_id, bug_id, date_modified, field_name, old_value, new_value, type )
VALUES
( ?, ?, ?, ?, ?, ?, ? )."
After that, the update in fact has been carried out, but it is not visible and traceable from the history.

Column 'old_value' in table mantis_bug_history_table is 'varchar 255', but should be 'longtext'? Same for column 'new_value'?

Steps To Reproduce

Write a long text (more then 255 characters) into a custom field of type Text Area. Store the entry. Then edit that entry, do some change to the text. Store that entry.

The error does not occure when using only short text.

TagsNo tags attached.

Relationships

related to 0024056 closedatrol Custom Fields of type "Textarea" cannot contain more than 255 chars due to bug_history table 
related to 0032365 closeddregad APPLICATION ERROR 401 when writing Custom Fields with more than 255 characters 
related to 0032385 closeddregad Incorrect use of mb_strimwidth() to truncate old/new values in history API 

Activities

atrol

atrol

2018-11-22 08:08

developer   ~0060994

This should be fixed since version 2.13.0 see 0024056.
Are you sure you are runnung 2.17.1?

atrol

atrol

2018-11-22 08:26

developer   ~0060995

Forget my previous note, I think I understand now what happened.

I was not able to reproduce because MySQL on my test system was running in some kind of auto truncate mode.

atrol

atrol

2018-11-22 16:40

developer   ~0060997

PR https://github.com/mantisbt/mantisbt/pull/1413

Related Changesets

MantisBT: master 4609e811

2018-11-22 11:16

atrol


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 old value can't be stored
in history table.

This change fixes the issue by truncating the string.

Fixes 0025002
Affected Issues
0025002
mod - core/history_api.php Diff File