Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0025030 | Openbravo ERP | A. Platform | public | 2013-10-26 00:45 | 2013-10-26 00:45 |
Reporter | chelipf | ||||
Assigned To | AugustoMauch | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 30 | OS Version | Debian Wheezy | |
Product Version | 3.0MP28.2 | ||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | No | ||||
Web browser | Mozilla Firefox | ||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0025030: getTableName method of ErrorTexParser class assumes the primary key column is linked to an element like tablenname + _ID | ||||
Description | What happens if I want to reuse the same element for two primary keys? for example purchase_authorization (primary key purchase authorization_id) and sales_authorization(primary key sales_authorization_id) tables. Your assumption forces to create two elements, one for each primary key. protected String getTableName(String tableName) { try { String pkColumnName = tableName + "_ID"; return ErrorTextParserData.selectColumnName(conn, language, pkColumnName); } catch (ServletException e) { log4j.error( "Error while trying to name for table via ad_element for tablename: " + tableName, e); } return tableName; } selectColumnName method ( select coalesce(ad_element_trl.name, ad_element.name) as column_name from ad_element left join ad_element_trl on ad_element.ad_element_id = ad_element_trl.ad_element_id and ad_element_trl.ad_language = ? where upper(ad_element.columnname) = upper(?)"; | ||||
Steps To Reproduce | create a new table and set the element of the primary key to an element which columnname is different from the column name. Set for example a unique constraint. The error message will get a null value as table name. | ||||
Proposed Solution | get the element linked to primary key column of the table, something like this: selectColumnName method ( select coalesce(ad_element_trl.name, ad_element.name) as column_name from ad_table t inner join ad_column c on t.ad_table_id = c.ad_table_id and c.ad_reference_id = '13' --ID Reference left join ad_element e on c.ad_element_id = e.ad_element_id left join ad_element_trl on ad_element.ad_element_id = ad_element_trl.ad_element_id and ad_element_trl.ad_language = ? where t.name = ?; ) | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-10-26 00:45 | chelipf | New Issue | |||
2013-10-26 00:45 | chelipf | Assigned To | => AugustoMauch | ||
2013-10-26 00:45 | chelipf | Web browser | => Mozilla Firefox | ||
2013-10-26 00:45 | chelipf | Modules | => Core | ||
2013-10-26 00:45 | chelipf | Triggers an Emergency Pack | => No |
There are no notes attached to this issue. |