diff --git a/src/core/expression/qgsexpressionutils.cpp b/src/core/expression/qgsexpressionutils.cpp index 1744e1272380..865055e550de 100644 --- a/src/core/expression/qgsexpressionutils.cpp +++ b/src/core/expression/qgsexpressionutils.cpp @@ -350,8 +350,9 @@ QString QgsExpressionUtils::getFilePathValue( const QVariant &value, const QgsEx ///@endcond -std::tuple QgsExpressionUtils::determineResultType( const QString &expression, const QgsVectorLayer *layer, const QgsFeatureRequest &r, QgsExpressionContext context, bool *foundFeatures ) +std::tuple QgsExpressionUtils::determineResultType( const QString &expression, const QgsVectorLayer *layer, const QgsFeatureRequest &r, const QgsExpressionContext &c, bool *foundFeatures ) { + QgsExpressionContext context = c; QgsFeatureRequest request = r; QgsExpression exp( expression ); request.setFlags( ( exp.needsGeometry() ) ? diff --git a/src/core/expression/qgsexpressionutils.h b/src/core/expression/qgsexpressionutils.h index b50645f4708d..67fea59714ab 100644 --- a/src/core/expression/qgsexpressionutils.h +++ b/src/core/expression/qgsexpressionutils.h @@ -504,7 +504,7 @@ class CORE_EXPORT QgsExpressionUtils * \param foundFeatures An optional boolean parameter that will be set when features are found. * \since QGIS 3.22 */ - static std::tuple determineResultType( const QString &expression, const QgsVectorLayer *layer, const QgsFeatureRequest &request = QgsFeatureRequest(), QgsExpressionContext context = QgsExpressionContext(), bool *foundFeatures = nullptr ); + static std::tuple determineResultType( const QString &expression, const QgsVectorLayer *layer, const QgsFeatureRequest &request = QgsFeatureRequest(), const QgsExpressionContext &context = QgsExpressionContext(), bool *foundFeatures = nullptr ); private: