Skip to content

Commit

Permalink
Followup 15546d8, fix matching of null representation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent fcf3361 commit 963e25e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,15 @@ void QgsRelationReferenceWidget::filterChanged()
if ( cb->currentIndex() != 0 )
{
const QString fieldName = cb->property( "Field" ).toString();
filters << QgsExpression::createFieldEqualityExpression( fieldName, cb->currentText() );

if ( cb->currentText() == nullValue.toString() )
{
filters << QStringLiteral( "\"%1\" IS NULL" ).arg( fieldName );
}
else
{
filters << QgsExpression::createFieldEqualityExpression( fieldName, cb->currentText() );
}
attrs << mReferencedLayer->fields().lookupField( fieldName );
}
}
Expand Down

0 comments on commit 963e25e

Please sign in to comment.