Skip to content

Commit

Permalink
take another try to get a valid relation in the relation reference wi…
Browse files Browse the repository at this point in the history
…dget (#35272)
  • Loading branch information
3nids committed Mar 25, 2020
1 parent a8c5e1d commit e723800
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -76,7 +76,7 @@ void QgsRelationReferenceWidgetWrapper::initWidget( QWidget *editor )
QgsRelation relation; // invalid relation by default
if ( relationName.isValid() )
relation = QgsProject::instance()->relationManager()->relation( relationName.toString() );
else if ( ! layer()->referencingRelations( fieldIdx() ).isEmpty() )
if ( !relation.isValid() && !layer()->referencingRelations( fieldIdx() ).isEmpty() )
relation = layer()->referencingRelations( fieldIdx() )[0];

// If this widget is already embedded by the same relation, reduce functionality
Expand Down

0 comments on commit e723800

Please sign in to comment.