Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0025030
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminoralways2013-10-26 00:452013-10-26 00:45
ReporterchelipfView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabasePostgreSQLJava version1.6.0_27
OS VersionDebian WheezyDatabase version9.1Ant version1.8.2
Product Version3.0MP28.2SCM revision 
Review Assigned To
Web browserMozilla Firefox
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0025030: getTableName method of ErrorTexParser class assumes the primary key column is linked to an element like tablenname + _ID

DescriptionWhat 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 Reproducecreate 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 Solutionget 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 = ?;
)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- 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
Powered by Mantis Bugtracker