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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034023
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajorhave not tried2016-09-19 22:262016-09-28 09:15
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in VersionRR16Q4
StatusclosedFix in branchFixed in SCM revisionc7609896cb41
ProjectionnoneETAnoneTarget VersionRR16Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034023: JSON error unexpected token in remote BP data when saving address through customer

DescriptionWhen 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 ReproduceLogin 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
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 ]
depends on backport 0034026RR16Q3.2 closedmtaal JSON error unexpected token in remote BP data when saving address through customer - remove unnecessary json set 
related to defect 0035998 closedmigueldejuana Javascript error editing the current customer on remote mode, using Terminal Authentication 

-  Notes
(0090092)
hgbot (developer)
2016-09-19 23:45

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: c7609896cb418d5f6a32497d46fc6abd033cde79
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Sep 19 23:45:16 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c7609896cb418d5f6a32497d46fc6abd033cde79 [^]

Fixes issue 33926: [STORE SERVER] Business partners are not updated when editing them in Web POS.
Save the changed bp/bploc in the local database and also refresh buttons

Fixes issue 34023: JSON error unexpected token in remote BP data when saving address through customer
Serialize json in the correct way

---
M web/org.openbravo.retail.posterminal/js/data/datacustomeraddrsave.js
M web/org.openbravo.retail.posterminal/js/data/datacustomersave.js
---
(0090325)
Sandrahuguet (developer)
2016-09-28 09:15

Reviewed and tested

- Issue History
Date Modified Username Field Change
2016-09-19 22:26 mtaal New Issue
2016-09-19 22:26 mtaal Assigned To => mtaal
2016-09-19 22:26 mtaal Triggers an Emergency Pack => No
2016-09-19 23:40 mtaal Status new => scheduled
2016-09-19 23:45 hgbot Checkin
2016-09-19 23:45 hgbot Note Added: 0090092
2016-09-19 23:45 hgbot Status scheduled => resolved
2016-09-19 23:45 hgbot Resolution open => fixed
2016-09-19 23:45 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c7609896cb418d5f6a32497d46fc6abd033cde79 [^]
2016-09-22 17:38 mtaal Review Assigned To => Sandrahuguet
2016-09-22 17:38 mtaal Description Updated View Revisions
2016-09-28 09:15 Sandrahuguet Note Added: 0090325
2016-09-28 09:15 Sandrahuguet Status resolved => closed
2016-09-28 09:15 Sandrahuguet Fixed in Version => RR16Q4
2017-05-16 16:28 migueldejuana Relationship added related to 0035998


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker