Skip to content

Commit

Permalink
Use createExpressionContext() to create context in a cleaner and safe…
Browse files Browse the repository at this point in the history
…r way as suggested

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
florianneukirchen and nyalldawson committed Dec 9, 2024
1 parent 7b238cc commit c763cf0
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c763cf0

Please sign in to comment.