Add join field to provider request also when requesting a subset of attributes

Fixes #8757
This commit is contained in:
Matthias Kuhn 2013-10-10 11:46:43 +02:00
parent b2ad0a9bb9
commit 5e14fea1b8

View File

@ -25,8 +25,6 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la
{
QgsVectorLayerJoinBuffer* joinBuffer = L->mJoinBuffer;
// by default provider's request is the same
mProviderRequest = mRequest;
mChangedFeaturesRequest = mRequest;
if ( L->editBuffer() )
@ -44,6 +42,9 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayer* la
if ( joinBuffer->containsJoins() )
prepareJoins();
// by default provider's request is the same
mProviderRequest = mRequest;
if ( mProviderRequest.flags() & QgsFeatureRequest::SubsetOfAttributes )
{
// prepare list of attributes to match provider fields
@ -208,7 +209,7 @@ bool QgsVectorLayerFeatureIterator::fetchNextAddedFeature( QgsFeature& f )
// must have changed geometry outside rectangle
continue;
if ( !mRequest.acceptFeature ( *mFetchAddedFeaturesIt ) )
if ( !mRequest.acceptFeature( *mFetchAddedFeaturesIt ) )
// skip features which are not accepted by the filter
continue;