Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0020365 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | minor | always | 2012-04-26 17:26 | 2012-06-27 05:29 | |||
Reporter | egoitz | View Status | public | |||||
Assigned To | migueldejuana | |||||||
Priority | high | Resolution | fixed | Fixed in Version | 3.0MP13 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 2c50e12c22aa | ||||
Projection | none | ETA | none | Target Version | 3.0MP13 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | 3.0MP10.1 | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | ||||||||
OBNetwork customer | OBPS | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | 15239 | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0020365: 'Length' word is not included on AD_ISJAVAWORD function to avoid to use it on column names | |||||||
Description | 'Length' word is not included on AD_ISJAVAWORD function to avoid to use it on column names. A part of that if lenght is used as field name you get a javascrip error because it is a reserved word for javascript. | |||||||
Steps To Reproduce | -Add a new column on a table with "Length" name (i.e.: c_invoice table) -Define the column on application dictionary with name "Length" (i.e.: Invoice table) -Create a new field for the previous column with name "Length" (i.e.: Sales Invoice window) - Login, open Sales Invoice window and open Form view. - You get a javascript error: "Uncaught RangeError: Invalid array length" | |||||||
Proposed Solution | Add lenght workd on AD_ISJAVAWORD function Create two new triggers , for ad_field and ad_element to avoid using the workds on the AD_ISJAVAWORD function also on elements or fields. The trigger AD_COLUMN_TRG2.xml checks it on column but also should be analyzed on fields and elements. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
||||||||
|
![]() |
|
(0048496) migueldejuana (viewer) 2012-05-09 11:28 |
I cannot reproduce. Following Steps to Reproduce, I don't get errors. What error should be showed? Using length as name for a field, I don't get javascript error. Steps to Reproduce? Elements and Columns have 'DBColumnName' and 'Name', both should be analyzed? |
(0049431) migueldejuana (viewer) 2012-05-29 15:03 |
The javascript error is in ob-view-form.js(line 527): localResult[fields[i].columnName.toLowerCase()] = fields[i]; We are trying to do this: localResult["length"] = fields[i]; It causes an error because length is a property of Array Object and we shouldn't use this reserved words as Array Object key. I have attached a diff with the proposed solution. |
(0049864) hgbot (developer) 2012-06-15 16:42 |
Repository: erp/devel/pi Changeset: 2c50e12c22aaa63d3b8660262965ff6687540713 Author: Miguel de Juana <miguel.dejuana <at> openbravo.com> Date: Thu May 24 13:41:52 2012 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/2c50e12c22aaa63d3b8660262965ff6687540713 [^] fixed bug 20365: Don't allow legth as column/field name as it causes js errors --- M src-db/database/model/functions/AD_ISJAVAWORD.xml M src-db/database/model/triggers/AD_COLUMN_TRG2.xml M src-db/database/model/triggers/AD_ELEMENT_TRG.xml M src-db/database/model/triggers/AD_FIELD_TRG.xml M src-db/database/sourcedata/AD_MESSAGE.xml --- |
(0049865) alostale (viewer) 2012-06-15 16:42 |
Code reviewed and tested in pi@2c50e12c22aa |
(0050006) hgbot (developer) 2012-06-22 09:00 |
Repository: erp/devel/pi Changeset: 4152ff6e040d482c19c62666ac07433caa412079 Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Fri Jun 22 08:58:59 2012 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/4152ff6e040d482c19c62666ac07433caa412079 [^] fixed bug 20827: Not possible to add new columns to ad_column table related to bug 20365 Partially backed out fix 0020365: field and element are not checked, just ad_column.columnname is checked with a different function to allow names that can be included for ad_colum.name. --- M src-db/database/model/functions/AD_ISJAVAWORD.xml M src-db/database/model/triggers/AD_COLUMN_TRG2.xml M src-db/database/model/triggers/AD_ELEMENT_TRG.xml M src-db/database/model/triggers/AD_FIELD_TRG.xml M src-db/database/sourcedata/AD_MESSAGE.xml A src-db/database/model/functions/AD_ISJAVASCRIPTWORD.xml --- |
(0050156) hudsonbot (viewer) 2012-06-27 05:29 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/cf3a7135839f [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2012-04-26 17:26 | egoitz | New Issue | |
2012-04-26 17:26 | egoitz | Assigned To | => alostale |
2012-04-26 17:26 | egoitz | Modules | => Core |
2012-04-26 17:26 | egoitz | OBNetwork customer | => Yes |
2012-04-26 17:26 | egoitz | Support ticket | => 15239 |
2012-04-26 17:26 | egoitz | Resolution time | => 1341093600 |
2012-04-27 07:48 | alostale | Assigned To | alostale => migueldejuana |
2012-05-09 11:28 | migueldejuana | Note Added: 0048496 | |
2012-05-09 11:28 | migueldejuana | Status | new => feedback |
2012-05-23 10:00 | egoitz | Status | feedback => new |
2012-05-23 10:00 | egoitz | Steps to Reproduce Updated | View Revisions |
2012-05-23 12:07 | shuehner | Issue Monitored: shuehner | |
2012-05-23 14:56 | migueldejuana | Steps to Reproduce Updated | View Revisions |
2012-05-29 15:03 | migueldejuana | Note Added: 0049431 | |
2012-05-29 15:03 | migueldejuana | File Added: 20365issue.export | |
2012-05-29 15:04 | migueldejuana | File Added: issue20365.commit | |
2012-05-29 15:04 | migueldejuana | File Deleted: 20365issue.export | |
2012-06-15 16:42 | hgbot | Checkin | |
2012-06-15 16:42 | hgbot | Note Added: 0049864 | |
2012-06-15 16:42 | hgbot | Status | new => resolved |
2012-06-15 16:42 | hgbot | Resolution | open => fixed |
2012-06-15 16:42 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/2c50e12c22aaa63d3b8660262965ff6687540713 [^] |
2012-06-15 16:42 | alostale | Note Added: 0049865 | |
2012-06-15 16:42 | alostale | Status | resolved => closed |
2012-06-15 16:42 | alostale | Fixed in Version | => 3.0MP13 |
2012-06-21 16:34 | alostale | Relationship added | related to 0020827 |
2012-06-22 09:00 | hgbot | Checkin | |
2012-06-22 09:00 | hgbot | Note Added: 0050006 | |
2012-06-27 05:29 | hudsonbot | Checkin | |
2012-06-27 05:29 | hudsonbot | Note Added: 0050156 |
Copyright © 2000 - 2009 MantisBT Group |