Skip to content
Permalink
Browse files

fixes invalid relation in search form

  • Loading branch information
github-actions authored and nyalldawson committed Jul 7, 2020
1 parent c28ed4a commit 78e08c3131cb7ab9765061eadc9244719166b842
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/gui/editorwidgets/qgsrelationreferencesearchwidgetwrapper.cpp
@@ -207,6 +207,9 @@ void QgsRelationReferenceSearchWidgetWrapper::initWidget( QWidget *editor )
}

QgsRelation relation = QgsProject::instance()->relationManager()->relation( config( QStringLiteral( "Relation" ) ).toString() );
// if no relation is given from the config, fetch one if there is only one available
if ( !relation.isValid() && !layer()->referencingRelations( mFieldIdx ).isEmpty() && layer()->referencingRelations( mFieldIdx ).count() == 1 )
relation = layer()->referencingRelations( mFieldIdx )[0];
mWidget->setRelation( relation, false );

mWidget->showIndeterminateState();

0 comments on commit 78e08c3

Please sign in to comment.
You can’t perform that action at this time.