Skip to content
Permalink
Browse files

Pass referencing record instead of referenced

  • Loading branch information
elpaso committed Nov 4, 2015
1 parent bd9cdae commit 086525b01bc49a64b67cde5f4e3a3b56a8c99507
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
@@ -245,8 +245,10 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant& value )
if ( !mReferencedLayer )
return;

// Attributes from the referencing layer
QgsAttributes attrs = QgsAttributes( mReferencingLayer->fields().count() );
attrs[mFkeyFieldIdx] = value;
// Set the value on the foreign key field of the referencing record
attrs[ mReferencingLayer->fieldNameIndex( mRelation.fieldPairs().at( 0 ).first )] = value;

QgsFeatureRequest request = mRelation.getReferencedFeatureRequest( attrs );

0 comments on commit 086525b

Please sign in to comment.