Skip to content

Commit 8e49e94

Browse files
committedSep 21, 2018
Tweak processing algorithm scope -- parameters should be available even if algorithm is unset
1 parent 2d3b8c8 commit 8e49e94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/qgsexpressioncontext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,14 +1297,14 @@ QgsExpressionContextScope *QgsExpressionContextUtils::processingAlgorithmScope(
12971297
Q_UNUSED( context );
12981298

12991299
std::unique_ptr< QgsExpressionContextScope > scope( new QgsExpressionContextScope( QObject::tr( "Algorithm" ) ) );
1300+
scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );
1301+
13001302
if ( !algorithm )
13011303
return scope.release();
13021304

13031305
//add standard algorithm variables
13041306
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "algorithm_id" ), algorithm->id(), true ) );
13051307

1306-
scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );
1307-
13081308
return scope.release();
13091309
}
13101310

0 commit comments

Comments
 (0)
Please sign in to comment.