Skip to content
Permalink
Browse files
[processing] Fix missing fields in data defined expression builder
when input layer is using selected features only

Fixes #40055
  • Loading branch information
nyalldawson authored and github-actions committed Jul 16, 2021
1 parent 5566654 commit 50cfb4f4f19e88ab357ba3f26757028371272685
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/processing/qgsprocessingwidgetwrapper.cpp
@@ -331,7 +331,15 @@ void QgsAbstractProcessingParameterWidgetWrapper::setDynamicParentLayerParameter
context = tmpContext.get();
}

QgsVectorLayer *layer = QgsProcessingParameters::parameterAsVectorLayer( parentWrapper->parameterDefinition(), parentWrapper->parameterValue(), *context );
QVariant val = parentWrapper->parameterValue();
if ( val.canConvert<QgsProcessingFeatureSourceDefinition>() )
{
// input is a QgsProcessingFeatureSourceDefinition - get extra properties from it
QgsProcessingFeatureSourceDefinition fromVar = qvariant_cast<QgsProcessingFeatureSourceDefinition>( val );
val = fromVar.source;
}

QgsVectorLayer *layer = QgsProcessingParameters::parameterAsVectorLayer( parentWrapper->parameterDefinition(), val, *context );
if ( !layer )
{
mPropertyButton->setVectorLayer( nullptr );

0 comments on commit 50cfb4f

Please sign in to comment.