Skip to content
Permalink
Browse files
Fix drill-down filtering on new features.
Fix #46369
  • Loading branch information
elpaso authored and m-kuhn committed Dec 27, 2021
1 parent a13b29f commit 39e0dacfcb9d6ee6716679640ff61e07966ebf85
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
@@ -331,7 +331,8 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionParentFormAttributes( co
QgsExpressionFunction *fd = QgsExpression::QgsExpression::Functions()[f->fnIndex()];
if ( formFunctions.contains( fd->name( ) ) )
{
for ( const auto &param : f->args( )->list() )
const QList<QgsExpressionNode *> cExpressionNodes { f->args( )->list() };
for ( const auto &param : std::as_const( cExpressionNodes ) )
{
attributes.insert( param->eval( &exp, &context ).toString() );
}
@@ -355,7 +356,8 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionFormAttributes( const QS
QgsExpressionFunction *fd = QgsExpression::QgsExpression::Functions()[f->fnIndex()];
if ( formFunctions.contains( fd->name( ) ) )
{
for ( const auto &param : f->args( )->list() )
const QList<QgsExpressionNode *> cExpressionNodes { f->args( )->list() };
for ( const auto &param : std::as_const( cExpressionNodes ) )
{
attributes.insert( param->eval( &exp, &context ).toString() );
}
@@ -371,7 +373,7 @@ bool QgsValueRelationFieldFormatter::expressionIsUsable( const QString &expressi
const QSet<QString> attrs = expressionFormAttributes( expression );
for ( auto it = attrs.constBegin() ; it != attrs.constEnd(); it++ )
{
if ( ! feature.attribute( *it ).isValid() )
if ( feature.fieldNameIndex( *it ) < 0 )
return false;
}

0 comments on commit 39e0dac

Please sign in to comment.