Skip to content
Permalink
Browse files

feature iterator: include attributes required by virtual fields first…

… so that

they trigger joins if necessary (fixes #11545)
  • Loading branch information
jef-n committed Jun 9, 2015
1 parent 77b405f commit cafbef1bb6bee42e677ce5eaf5c8725ea844be34
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/qgsvectorlayerfeatureiterator.cpp
@@ -90,13 +90,12 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayerFeat
, mFetchedFid( false )
, mEditGeometrySimplifier( 0 )
{
prepareExpressions();

// prepare joins: may add more attributes to fetch (in order to allow join)
if ( mSource->mJoinBuffer->containsJoins() )
prepareJoins();

prepareExpressions();

mHasVirtualAttributes = !mFetchJoinInfo.isEmpty() || !mExpressionFieldInfo.isEmpty();

// by default provider's request is the same
@@ -507,7 +506,7 @@ void QgsVectorLayerFeatureIterator::prepareExpressions()
if ( mRequest.flags() & QgsFeatureRequest::SubsetOfAttributes )
{
QgsAttributeList attrs;
Q_FOREACH ( const QString& col, exp->referencedColumns() )
Q_FOREACH( const QString& col, exp->referencedColumns() )
{
attrs.append( mSource->mFields.fieldNameIndex( col ) );
}

0 comments on commit cafbef1

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