Skip to content

Commit

Permalink
Merge pull request #26 from g3w-suite/fix_copy_feature_from_external_…
Browse files Browse the repository at this point in the history
…added_layer_wrong_missing_field_property_send

Send right fields on copy feature from external layer tool
  • Loading branch information
volterra79 authored Mar 9, 2023
2 parents 3c64477 + 9d47f57 commit af5886c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions workflows/steps/tasks/selectelementstask.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,21 @@ proto.addExternalSelectInteraction = function({layer, inputs, context, promise,
const attributes = layer.getEditingFields();
const geometry = evt.feature.getGeometry();
(geometry.getType() !== layerGeometryType) && evt.feature.setGeometry(convertSingleMultiGeometry(geometry, layerGeometryType));
attributes.forEach(attribute => {
evt.feature.set(attribute.name, null);
});
const feature = new Feature({
feature: evt.feature
feature: evt.feature,
properties: attributes.map(attribute => {
//set media attribute to null or attribute belong to layer but not present o feature copied
if (
attribute.input.type === 'media' ||
"undefined" === typeof evt.feature.get(attribute.name
)
) {
evt.feature.set(attribute.name, null);
}
return attribute.name
})
});

// evaluate Geometry Expression
this.evaluateGeometryExpressionField({
inputs,
Expand Down

0 comments on commit af5886c

Please sign in to comment.