Skip to content

Commit

Permalink
Fix drill-down filtering on new features.
Browse files Browse the repository at this point in the history
Fix #46369
  • Loading branch information
elpaso authored and github-actions[bot] committed Dec 11, 2021
1 parent 9d5fb80 commit d08d2fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
Expand Up @@ -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() );
}
Expand All @@ -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() );
}
Expand All @@ -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;
}

Expand Down

0 comments on commit d08d2fc

Please sign in to comment.