Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wsdata
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
wsdata
Commits
0f1f971d
Commit
0f1f971d
authored
10 years ago
by
Mathew Winstone
Browse files
Options
Downloads
Patches
Plain Diff
Added keying by remote key
parent
4ce1a5ce
Branches
wsfieldswrite
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/wsfields/wsfields.module
+16
-3
16 additions, 3 deletions
modules/wsfields/wsfields.module
with
16 additions
and
3 deletions
modules/wsfields/wsfields.module
+
16
−
3
View file @
0f1f971d
...
...
@@ -337,7 +337,7 @@ function wsfields_data_write($entity_type, $entity, $op, $field, $items) {
// Load required settings from the field instance
$wsconfig_name
=
$field
[
'storage'
][
'settings'
][
'wsconfig_name'
];
$remote
name
=
$field
[
'storage'
][
'settings'
][
'remotekey'
];
$remote
key
=
$field
[
'storage'
][
'settings'
][
'remotekey'
];
$passaccepts
=
isset
(
$field
[
'storage'
][
'settings'
][
'passaccepts'
])
?
$field
[
'storage'
][
'settings'
][
'passaccepts'
]
:
TRUE
;
$processor
=
$field
[
'storage'
][
'settings'
][
'processor'
];
$propertymap
=
$field
[
'storage'
][
'settings'
][
'propertymap'
][
'read'
];
...
...
@@ -363,9 +363,11 @@ function wsfields_data_write($entity_type, $entity, $op, $field, $items) {
$value
=
FALSE
;
if
(
isset
(
$ws_keys
[
$entity_property
]))
{
$value
=
$ws_keys
[
$entity_property
];
}
elseif
(
isset
(
$entity
->
$entity_property
))
{
}
elseif
(
isset
(
$entity
->
$entity_property
))
{
$value
=
$entity
->
$entity_property
;
}
else
{
}
else
{
if
(
WSFIELDS_DEBUG
)
debug
(
"Couldn't find pattern: "
.
$pattern
);
return
FALSE
;
}
...
...
@@ -403,6 +405,17 @@ function wsfields_data_write($entity_type, $entity, $op, $field, $items) {
$options
[
'accept-type'
]
=
array_pop
(
$type
);
}
// Key the items based on the remote key
if
(
count
(
$items
)
>
1
)
{
// @todo
}
else
{
$items
=
reset
(
$items
);
// @todo figure out how to support fields with different column names
$items
[
$remotekey
]
=
$items
[
'value'
];
unset
(
$items
[
'value'
]);
}
// Write the data
$data
=
$wsconfig
->
call
(
$op
,
$replacements
,
$items
,
$options
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment