Skip to content

Commit c2699b4

Browse files
committed
[processing] reset variables list in field calculator on layer change (fix #15633)
1 parent eda1730 commit c2699b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def manageGui(self):
105105
self.mOutputFieldTypeComboBox.blockSignals(False)
106106
self.builder.loadRecent('fieldcalc')
107107

108-
self.initContext()
109108
self.updateLayer(self.cmbInputLayer.currentLayer())
110109

111110
def initContext(self):
@@ -117,6 +116,8 @@ def initContext(self):
117116

118117
def updateLayer(self, layer):
119118
self.layer = layer
119+
120+
self.initContext()
120121
self.builder.setLayer(self.layer)
121122
self.builder.loadFieldNames()
122123
self.populateFields()

src/gui/qgsexpressionbuilderwidget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ void QgsExpressionBuilderWidget::setExpressionText( const QString &expression )
516516
void QgsExpressionBuilderWidget::setExpressionContext( const QgsExpressionContext &context )
517517
{
518518
mExpressionContext = context;
519-
520-
loadExpressionContext();
519+
updateFunctionTree();
521520
}
522521

523522
void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()

0 commit comments

Comments
 (0)