Skip to content

Commit

Permalink
Merge pull request #3166 from nirvn/fix_processing_refactor_fields
Browse files Browse the repository at this point in the history
[processing] fix missing quotes to field name in refactor fields
  • Loading branch information
alexbruy authored Jun 10, 2016
2 parents 37598bd + 14342ce commit 895b955
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 @@ -220,7 +220,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 @@ -292,7 +292,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:
QStyledItemDelegate.setModelData(self, editor, model, index)
Expand Down

0 comments on commit 895b955

Please sign in to comment.