Skip to content
Permalink
Browse files

fix get layer from output sink from previous algorithm in modeler

  • Loading branch information
luipir committed Sep 13, 2018
1 parent 0f07c41 commit 2a19a1d655f480742d555f4a009912a0b4b765fd
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/processing/qgsprocessingparameters.cpp
@@ -528,6 +528,18 @@ QgsMapLayer *QgsProcessingParameters::parameterAsLayer( const QgsProcessingParam
return layer;
}

if ( val.canConvert<QgsProcessingOutputLayerDefinition>() )
{
// input is a QgsProcessingOutputLayerDefinition - get extra properties from it
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( val );
val = fromVar.sink;
}

if ( val.canConvert<QgsProperty>() && val.value< QgsProperty >().propertyType() == QgsProperty::StaticProperty )
{
val = val.value< QgsProperty >().staticValue();
}

if ( !val.isValid() || val.toString().isEmpty() )
{
// fall back to default

0 comments on commit 2a19a1d

Please sign in to comment.
You can’t perform that action at this time.