Skip to content
Permalink
Browse files

Use layer context in RefactorFields algorithm

Fix #17533
  • Loading branch information
m-kuhn committed Nov 23, 2017
1 parent 851adb0 commit cd0ba918ba6508b57b6ef78dc20fcd465d28d4da
Showing with 3 additions and 2 deletions.
  1. +3 −2 python/plugins/processing/algs/qgis/FieldsMapper.py
@@ -121,6 +121,9 @@ def prepareAlgorithm(self, parameters, context, feedback):
da.setSourceCrs(source.sourceCrs())
da.setEllipsoid(context.project().ellipsoid())

# create an expression context using thread safe processing context
self.expr_context = self.createExpressionContext(parameters, context, source)

for field_def in mapping:
self.fields.append(QgsField(name=field_def['name'],
type=field_def['type'],
@@ -143,8 +146,6 @@ def outputFields(self, inputFields):
return self.fields

def processAlgorithm(self, parameters, context, feeback):
# create an expression context using thead safe processing context
self.expr_context = self.createExpressionContext(parameters, context)
for expression in self.expressions:
expression.prepare(self.expr_context)
self._row_number = 0

0 comments on commit cd0ba91

Please sign in to comment.
You can’t perform that action at this time.