Skip to content

Commit

Permalink
Tweak processing algorithm scope -- parameters should be available ev…
Browse files Browse the repository at this point in the history
…en if algorithm is unset
  • Loading branch information
nyalldawson committed Sep 21, 2018
1 parent 2d3b8c8 commit 8e49e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsexpressioncontext.cpp
Expand Up @@ -1297,14 +1297,14 @@ QgsExpressionContextScope *QgsExpressionContextUtils::processingAlgorithmScope(
Q_UNUSED( context );

std::unique_ptr< QgsExpressionContextScope > scope( new QgsExpressionContextScope( QObject::tr( "Algorithm" ) ) );
scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );

if ( !algorithm )
return scope.release();

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

scope->addFunction( QStringLiteral( "parameter" ), new GetProcessingParameterValue( parameters ) );

return scope.release();
}

Expand Down

0 comments on commit 8e49e94

Please sign in to comment.