View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014650 | mantisbt | code cleanup | public | 2012-08-25 19:46 | 2014-09-23 18:05 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.12 | ||||
Target Version | 1.2.12 | Fixed in Version | 1.2.12 | ||
Summary | 0014650: Improve comments for check custom field length in custom_field_delete_all_values() | ||||
Description | This function checks for truncated custom field's name. This dates back to the time when the history table's field_name column was only 32 chars long, whereas the custom field's size is 64. Even though the history's field_name size has been increased to 64 since However the comments in the code are a bit misleading as they refer to obsolete db schema. | ||||
Tags | No tags attached. | ||||
I'm having second thoughts about this. Considering that it's such a corner case (only applicable for initial Mantis deployment prior to 1.1.0 having custom fields with names longer than 32 chars), maybe it would be a better approach to get rid of this special case check and provide instead a short script to update the legacy systems' database (replacing the truncated custom field names references in history table by their full name using the same logic in the check). |
|
Following my previous note, I revised the install/upgrade script in master branch accordingly, and removed the obsolete code. Since schema changes are not possible in 1.2.x branch, the code will remain the same, with improved comments. |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master ce3450aa 2012-08-31 03:17 Details Diff |
Add upgrade step to replace truncated custom field names in history Function custom_field_get_id_from_name() contained code to check for truncated custom fields names. This dates back to when the history table's field_name column was only 32 chars long, whereas the custom field's size is 64. The history's field_name size has been increased to 64 since 1.1.0a4 (see issue 0008002), so the check has been removed from the code and replaced by an upgrade step (calling new install helper function install_update_history_long_custom_fields(), which converts legacy history entries storing truncated custom field names by their expanded full name. Fixes 0014650 |
Affected Issues 0008002, 0014650 |
|
mod - admin/schema.php | Diff File | ||
mod - core/custom_field_api.php | Diff File | ||
mod - core/history_api.php | Diff File | ||
mod - core/install_helper_functions_api.php | Diff File | ||
MantisBT: master-1.2.x b5abce1f 2012-08-31 03:37 Details Diff |
Improve comments for custom field length check Function custom_field_get_id_from_name() contains code to check for truncated custom fields names. This dates back to when the history table's field_name column was only 32 chars long, whereas the custom field's size is 64. Even though the history's field_name size has been increased to 64 since 1.1.0a4 (see issue 0008002), the check must be maintained to ensure compatibility with upgraded legacy systems. The fix ce3450aaabbd9d9feceb03d77d4358f195e7d966 implemented in master branch cannot be applied here as it contains a schema update. Instead, comments have been reworded and obsolete reference to old schema removed. Fixes 0014650 |
Affected Issues 0008002, 0014650 |
|
mod - core/custom_field_api.php | Diff File | ||
mod - core/history_api.php | Diff File |