Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014811Openbravo ERPZ. Otherspublic2010-10-07 12:322011-05-24 10:57
eintelau 
dbaz 
normalminorhave not tried
closedfixed 
205.2
2.50 
 
User Interface Application
No
0014811: Javascript errors validating OBNumberItem result in selector popup failing
I struck this problem when reconciling a financial account with an imported bank statement. When I clicked the find link in the reconcile window the selector would start loading then hang.

The hang was caused by a javascript error in ob_formitem_widgets.js:
  "this.OBNumberItemElement is null" on line 530
(error messages paraphrased from memory)

After fixing that error I had another one on line 579:
  "number.match is not a method"

That one was occuring because number was a integer (I assume because the value had been set from the JSON response not the UI), not a string and hence didn't have a match method.

I was able to fix the issue, but am not sure why the validation method was being called on the selector load. Especially since the error seems to be occurring on the lineNo field which is not displayed by that selector
1) Set this.OBNumberItemElement from the form parameter in the OBNumberItem validate method

2) Ensure number parameter is a string before performing regex check in validateNumber method
closingMay2011
patch 14811.patch (1,156) 2010-10-07 12:48
https://issues.openbravo.com/file_download.php?file_id=3185&type=bug
Issue History
2010-10-07 12:32eintelauNew Issue
2010-10-07 12:32eintelauAssigned To => mtaal
2010-10-07 12:41mtaalAssigned Tomtaal => dbaz
2010-10-07 12:48eintelauFile Added: 14811.patch
2010-10-07 12:49eintelauNote Added: 0031638
2010-10-07 12:49eintelauIssue Monitored: eintelau
2010-10-07 19:01dbazNote Added: 0031663
2010-10-07 19:02hgbotCheckin
2010-10-07 19:02hgbotNote Added: 0031664
2010-10-07 19:02hgbotStatusnew => resolved
2010-10-07 19:02hgbotResolutionopen => fixed
2010-10-07 19:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.client.application/rev/ec6bb1d177460661dce3e2b26067c81ce4fc8fab [^]
2010-10-11 05:03eintelauNote Added: 0031723
2011-05-24 09:59dalsasuaTag Attached: closingMay2011
2011-05-24 10:57dalsasuaStatusresolved => closed

Notes
(0031638)
eintelau   
2010-10-07 12:49   
Patch with suggested fix is attached

I'm not comfortable pushing a fix directly into the repository as I don't understand this code well enough.
(0031663)
dbaz   
2010-10-07 19:01   
Thank you very much eintelau

I am going to fix the issue in a slightly different way.

Please check if you are still experiencing the issue.

Regards and thanks again!
(0031664)
hgbot   
2010-10-07 19:02   
Repository: erp/mods/org.openbravo.client.application
Changeset: ec6bb1d177460661dce3e2b26067c81ce4fc8fab
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Thu Oct 07 19:02:11 2010 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.client.application/rev/ec6bb1d177460661dce3e2b26067c81ce4fc8fab [^]

Fixed issue 14811: Removed JS errors in OBNumberItem

---
M web/org.openbravo.client.application/js/ob_formitem_widgets.js
---
(0031723)
eintelau   
2010-10-11 05:03   
Hi David,

I have just tested the fix that you committed and I still get a javascript error
"this.OBNumberItemElement is null" on the line "maskNumeric = this.OBNumberItemElement.maskNumeric;" within the validateNumber function.

regards
Ben