Skip to content

Commit

Permalink
[processing] fix missing quotes to field name in refactor fields
Browse files Browse the repository at this point in the history
(cherry-picked from 14342ce)
  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent 33e2aa6 commit 449bb4f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def newField(self, field=None):
'type': field.type(),
'length': field.length(),
'precision': field.precision(),
'expression': field.name()}
'expression': QgsExpression.quotedColumnRef(field.name())}

def loadLayerFields(self, layer):
self.beginResetModel()
Expand Down Expand Up @@ -289,7 +289,10 @@ def setModelData(self, editor, model, index):

elif fieldType == QgsExpression:
(value, isExpression, isValid) = editor.currentField()
model.setData(index, value)
if isExpression is True:
model.setData(index, value)
else:
model.setData(index, QgsExpression.quotedColumnRef(value))

else:
QtGui.QStyledItemDelegate.setModelData(self, editor, model, index)
Expand Down

0 comments on commit 449bb4f

Please sign in to comment.