Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
jio
Commits
a711db81
Commit
a711db81
authored
Mar 07, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid hasOwnProperty metadata bug
parent
da69917f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+7
-3
No files found.
src/jio.storage/erp5storage.js
View file @
a711db81
...
...
@@ -26,6 +26,10 @@
],
function
(
RSVP
,
jIO
,
URI
)
{
"
use strict
"
;
var
hasOwnProperty
=
Function
.
prototype
.
call
.
bind
(
Object
.
prototype
.
hasOwnProperty
);
function
ERP5Storage
(
spec
)
{
if
(
typeof
spec
.
url
!==
"
string
"
||
!
spec
.
url
)
{
throw
new
TypeError
(
"
ERP5 'url' must be a string
"
+
...
...
@@ -95,7 +99,7 @@
key
;
for
(
key
in
metadata
)
{
if
(
metadata
.
hasOwnProperty
(
key
))
{
if
(
hasOwnProperty
(
metadata
,
key
))
{
// XXX Not a form dialog in this case but distant script
data
.
append
(
key
,
metadata
[
key
]);
}
...
...
@@ -135,10 +139,10 @@
data
.
append
(
renderer_form
.
form_id
.
key
,
renderer_form
.
form_id
[
'
default
'
]);
for
(
key
in
metadata
)
{
if
(
metadata
.
hasOwnProperty
(
key
))
{
if
(
hasOwnProperty
(
metadata
,
key
))
{
if
(
key
!==
"
_id
"
)
{
// Hardcoded my_ ERP5 behaviour
if
(
renderer_form
.
hasOwnProperty
(
"
my_
"
+
key
))
{
if
(
hasOwnProperty
(
renderer_form
,
"
my_
"
+
key
))
{
data
.
append
(
renderer_form
[
"
my_
"
+
key
].
key
,
metadata
[
key
]);
}
else
{
throw
new
Error
(
"
Can not save property
"
+
key
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment