Skip to content

Commit 6d3f1b8

Browse files
committed
Fix issue with combination of edit buffer + vector join
1 parent 7397bd8 commit 6d3f1b8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/core/qgsvectorlayerfeatureiterator.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ QgsFeatureIterator QgsVectorLayerFeatureSource::getFeatures( const QgsFeatureReq
5555
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
5656
: QgsAbstractFeatureIteratorFromSource( source, ownSource, request )
5757
{
58-
mChangedFeaturesRequest = mRequest;
59-
60-
if ( mSource->mHasEditBuffer )
61-
{
62-
mChangedFeaturesRequest.setFilterFids( mSource->mChangedAttributeValues.keys().toSet() );
63-
}
6458

6559
// prepare joins: may add more attributes to fetch (in order to allow join)
6660
if ( mSource->mJoinBuffer->containsJoins() )
@@ -85,6 +79,12 @@ QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(QgsVectorLayerFeatu
8579
mProviderRequest.setSubsetOfAttributes( providerSubset );
8680
}
8781

82+
if ( mSource->mHasEditBuffer )
83+
{
84+
mChangedFeaturesRequest = mProviderRequest;
85+
mChangedFeaturesRequest.setFilterFids( mSource->mChangedAttributeValues.keys().toSet() );
86+
}
87+
8888
if ( request.filterType() == QgsFeatureRequest::FilterFid )
8989
{
9090
mFetchedFid = false;
@@ -302,6 +302,9 @@ bool QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature( QgsFeature
302302

303303
updateChangedAttributes( f );
304304

305+
if ( !mFetchJoinInfo.isEmpty() )
306+
addJoinedAttributes( f );
307+
305308
if ( mRequest.filterType() == QgsFeatureRequest::FilterExpression )
306309
{
307310
if ( mRequest.filterExpression()->evaluate( &f ).toBool() )

0 commit comments

Comments
 (0)