Skip to content
Permalink
Browse files

[processing] fix missing quotes to field name in refactor fields

(cherry-picked from 14342ce)
  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent 33e2aa6 commit 449bb4f7080ca6c9bfe1e12a362b51f18c53c2d7
Showing with 5 additions and 2 deletions.
  1. +5 −2 python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
@@ -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()
@@ -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)

0 comments on commit 449bb4f

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