Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0025030 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
design defect | [Openbravo ERP] A. Platform | minor | always | 2013-10-26 00:45 | 2013-10-26 00:45 | |||||||
Reporter | chelipf | View Status | public | |||||||||
Assigned To | AugustoMauch | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Linux 64 bit | Database | PostgreSQL | Java version | 1.6.0_27 | |||||||
OS Version | Debian Wheezy | Database version | 9.1 | Ant version | 1.8.2 | |||||||
Product Version | 3.0MP28.2 | SCM revision | ||||||||||
Review Assigned To | ||||||||||||
Web browser | Mozilla Firefox | |||||||||||
Modules | Core | |||||||||||
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 = ?; ) | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
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 |
Copyright © 2000 - 2009 MantisBT Group |