From c763cf0cea51825ded0cee06b2163c0a36bdbeef Mon Sep 17 00:00:00 2001 From: Florian Neukirchen <99167742+florianneukirchen@users.noreply.github.com> Date: Mon, 9 Dec 2024 07:32:35 +0100 Subject: [PATCH] Use createExpressionContext() to create context in a cleaner and safer way as suggested Co-authored-by: Nyall Dawson --- .../processing/algs/qgis/VectorLayerScatterplot.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/python/plugins/processing/algs/qgis/VectorLayerScatterplot.py b/python/plugins/processing/algs/qgis/VectorLayerScatterplot.py index df76af40cf98..967fb606fa6d 100644 --- a/python/plugins/processing/algs/qgis/VectorLayerScatterplot.py +++ b/python/plugins/processing/algs/qgis/VectorLayerScatterplot.py @@ -186,13 +186,7 @@ def processAlgorithm(self, parameters, context, feedback): parameters, self.HOVERTEXT, context ) if hoverexpression.strip(): - exp_context = QgsExpressionContext() - vlayer = QgsProcessingUtils.mapLayerFromString( - parameters[self.INPUT], context - ) - exp_context.appendScopes( - QgsExpressionContextUtils.globalProjectLayerScopes(vlayer) - ) + exp_context = self.createExpressionContext(parameters, context, source) hoverexpression = QgsExpression(hoverexpression) if hoverexpression.hasParserError(): feedback.reportError(