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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034026
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] StoreServermajorhave not tried2016-09-19 22:262016-09-29 17:28
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision4eeb7af92ff1
ProjectionnoneETAnoneTarget VersionRR16Q3.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomigueldejuana
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034026: JSON error unexpected token in remote BP data when saving address through customer - remove unnecessary json set

DescriptionSolve two issues:
1) json error when saving customer
2) unnecessary and incorrect setting of json property in object

When editing and saving an address through the customer then the error ' Unexpected token o in JSON at position 1' is reported.

Strack trace:

ce25035…_WebPOS.js:2856 SyntaxError: Unexpected token o in JSON at position 1
    at http://store1.openbravo.com:8080/openbravo/web/js/gen/ce2503585cded83ecbab0c78d4c7719d_WebPOS.js:7314:32 [^]
    at Array.forEach (native)
    at Function.b.each.b.forEach (http://store1.openbravo.com:8080/openbravo/web/org.openbravo.mobile.core/lib/vendor/underscore-1.3.3.min.js:11:39 [^])
    at r.(anonymous function) [as each] (http://store1.openbravo.com:8080/openbravo/web/org.openbravo.mobile.core/lib/vendor/backbone-0.9.2.min.js:25:314 [^])
    at http://store1.openbravo.com:8080/openbravo/web/js/gen/ce2503585cded83ecbab0c78d4c7719d_WebPOS.js:7312:21 [^]
    at processResult (http://store1.openbravo.com:8080/openbravo/web/js/gen/ce2503585cded83ecbab0c78d4c7719d_WebPOS.js:4180:11 [^]); line: Object.OB.UTIL.showError (http://store1.openbravo.com:8080/openbravo/web/js/gen/ce2503585cded83ecbab0c78d4c7719d_WebPOS.js:11173:6 [^]) (*,+)processConsoleLevel @ ce25035…_WebPOS.js:2856OB.error @ ce25035…_WebPOS.js:2886OB.UTIL.showError @ ce25035…_WebPOS.js:11173window.onerror @ ce25035…_WebPOS.js:22654
VM87:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
Steps To ReproduceTopic 1:
Set remote BP properties
Login to webpos
Click on Menu
Select Customers
Search any customer
Click on customer
click on create new address
Create a new address
Save

Note the error only occurs if you first go through the customers menu not when going through the customer/address button

Topic 2:
Put breakpoints in the changed locations and check what is being set in the object's json property
Proposed SolutionThe error is caused by this line:
bpLocToSave.set('json', customerAddr.serializeToJSON());

Here:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/200182f3db29/web/org.openbravo.retail.posterminal/js/data/datacustomeraddrsave.js#l57 [^]

It must be changed to:
bpLocToSave.set('json', JSON.stringify(customerAddr.serializeToJSON()));
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0034023RR16Q4 closedmtaal JSON error unexpected token in remote BP data when saving address through customer 
blocks defect 0034077RR16Q4 closedmtaal Unnecessary set of json property with wrong value when saving cusotmer(address) 

-  Notes
(0090232)
mtaal (manager)
2016-09-25 14:42

In the end the solution was to remove all the lines which made no sense to have anyway and which were incorrect.
(0090234)
hgbot (developer)
2016-09-25 14:42

Repository: retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal
Changeset: 4eeb7af92ff117002a3ec8ed9d46f504aab680c4
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Sep 25 14:42:19 2016 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal/rev/4eeb7af92ff117002a3ec8ed9d46f504aab680c4 [^]

Fixes issue 34026: JSON error unexpected token in remote BP data when saving address through customer - remove unnecessary json set
Removed unneeded and incorrect lines

---
M web/org.openbravo.retail.posterminal/js/data/datacustomeraddrsave.js
M web/org.openbravo.retail.posterminal/js/data/datacustomersave.js
---
(0090385)
migueldejuana (developer)
2016-09-29 17:28

Tested and reviewed

- Issue History
Date Modified Username Field Change
2016-09-19 23:40 mtaal Type defect => backport
2016-09-19 23:40 mtaal Target Version RR16Q4 => RR16Q3.3
2016-09-25 12:18 mtaal Relationship added blocks 0034077
2016-09-25 12:19 mtaal Target Version RR16Q3.3 => RR16Q3.2
2016-09-25 12:19 mtaal Summary JSON error unexpected token in remote BP data when saving address through customer => JSON error unexpected token in remote BP data when saving address through customer - remove unnecessary json set
2016-09-25 12:19 mtaal Description Updated View Revisions
2016-09-25 12:20 mtaal Review Assigned To => migueldejuana
2016-09-25 12:20 mtaal Steps to Reproduce Updated View Revisions
2016-09-25 14:42 mtaal Note Added: 0090232
2016-09-25 14:42 hgbot Checkin
2016-09-25 14:42 hgbot Note Added: 0090234
2016-09-25 14:42 hgbot Status scheduled => resolved
2016-09-25 14:42 hgbot Resolution open => fixed
2016-09-25 14:42 hgbot Fixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR16Q3.2/org.openbravo.retail.posterminal/rev/4eeb7af92ff117002a3ec8ed9d46f504aab680c4 [^]
2016-09-29 17:28 migueldejuana Note Added: 0090385
2016-09-29 17:28 migueldejuana Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker