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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020365
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2012-04-26 17:262012-06-27 05:29
ReporteregoitzView Statuspublic 
Assigned Tomigueldejuana 
PriorityhighResolutionfixedFixed in Version3.0MP13
StatusclosedFix in branchFixed in SCM revision2c50e12c22aa
ProjectionnoneETAnoneTarget Version3.0MP13
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0MP10.1SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
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 SolutionAdd 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.
TagsNo tags attached.
Attached Files? file icon issue20365.commit [^] (8,040 bytes) 2012-05-29 15:04

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0020827 closedalostale Not possible to add new columns to ad_column table 

-  Notes
(0048496)
migueldejuana (developer)
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 (developer)
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 (manager)
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 (developer)
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

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