Skip to content

Commit 449bb4f

Browse files
committedJun 30, 2016
[processing] fix missing quotes to field name in refactor fields
(cherry-picked from 14342ce)
1 parent 33e2aa6 commit 449bb4f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def newField(self, field=None):
217217
'type': field.type(),
218218
'length': field.length(),
219219
'precision': field.precision(),
220-
'expression': field.name()}
220+
'expression': QgsExpression.quotedColumnRef(field.name())}
221221

222222
def loadLayerFields(self, layer):
223223
self.beginResetModel()
@@ -289,7 +289,10 @@ def setModelData(self, editor, model, index):
289289

290290
elif fieldType == QgsExpression:
291291
(value, isExpression, isValid) = editor.currentField()
292-
model.setData(index, value)
292+
if isExpression is True:
293+
model.setData(index, value)
294+
else:
295+
model.setData(index, QgsExpression.quotedColumnRef(value))
293296

294297
else:
295298
QtGui.QStyledItemDelegate.setModelData(self, editor, model, index)

0 commit comments

Comments
 (0)
Please sign in to comment.