Skip to content

Commit

Permalink
Re-add NULL in "Field and Values" expression
Browse files Browse the repository at this point in the history
Fixes #37099
  • Loading branch information
elpaso authored and nyalldawson committed Jun 10, 2020
1 parent 13bd846 commit dc7f729
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/qgsexpressiontreeview.cpp
Expand Up @@ -426,10 +426,14 @@ void QgsExpressionTreeView::loadFieldNames( const QgsFields &fields )

void QgsExpressionTreeView::loadFieldNames()
{
// Cleanup
if ( mExpressionGroups.contains( QStringLiteral( "Fields and Values" ) ) )
{
QgsExpressionItem *node = mExpressionGroups.value( QStringLiteral( "Fields and Values" ) );
node->removeRows( 0, node->rowCount() );
// Re-add NULL
// use -1 as sort order here -- NULL should always show before the field list
registerItem( QStringLiteral( "Fields and Values" ), QStringLiteral( "NULL" ), QStringLiteral( "NULL" ), QString(), QgsExpressionItem::ExpressionNode, false, -1 );
}

// this can happen if fields are manually set
Expand Down

0 comments on commit dc7f729

Please sign in to comment.