Skip to content
Permalink
Browse files

Fixed disappearing item issue when subform editing

  see #11266
  • Loading branch information
elpaso committed Nov 4, 2015
1 parent 8187ad5 commit 93bd825e1e29bc4433d933e90c4c07cb3bf31643
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/qgsrelation.cpp
@@ -187,18 +187,19 @@ QgsFeatureRequest QgsRelation::getReferencedFeatureRequest( const QgsAttributes&
{
int referencedIdx = referencedLayer()->fields().indexFromName( fieldPair.referencedField() );
int referencingIdx = referencingLayer()->fields().indexFromName( fieldPair.referencingField() );
Q_UNUSED(referencingIdx);

QgsField referencedField = referencedLayer()->fields().at( referencedIdx );

if ( referencedField.type() == QVariant::String )
{
// Use quotes
conditions << QString( "\"%1\" = '%2'" ).arg( fieldPair.referencedField(), attributes.at( referencingIdx ).toString() );
conditions << QString( "\"%1\" = '%2'" ).arg( fieldPair.referencedField(), attributes.at( referencedIdx ).toString() );
}
else
{
// No quotes
conditions << QString( "\"%1\" = %2" ).arg( fieldPair.referencedField(), attributes.at( referencingIdx ).toString() );
conditions << QString( "\"%1\" = %2" ).arg( fieldPair.referencedField(), attributes.at( referencedIdx ).toString() );
}
}

0 comments on commit 93bd825

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