Skip to content

Commit a6e2fc1

Browse files
Update qgsvectorlayereditbuffer.cpp
1 parent f8834f2 commit a6e2fc1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/core/qgsvectorlayereditbuffer.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,15 @@ bool QgsVectorLayerEditBuffer::addFeature( QgsFeature& f )
9999
{
100100
return false;
101101
}
102-
103-
int layerFieldCount = L->dataProvider()->fields().count() + mAddedAttributes.count() - mDeletedAttributeIds.count();
102+
int layerFieldJoinCount=0;
103+
for ( int i = 0; i < L->mUpdatedFields.count(); ++i )
104+
{
105+
if ( L->mUpdatedFields.fieldOrigin(i)==QgsFields::OriginJoin )
106+
{
107+
layerFieldJoinCount++;
108+
}
109+
}
110+
int layerFieldCount = L->dataProvider()->fields().count() + layerFieldJoinCount + mAddedAttributes.count() - mDeletedAttributeIds.count();int layerFieldCount = L->dataProvider()->fields().count() + mAddedAttributes.count() - mDeletedAttributeIds.count();
104111
if ( layerFieldCount != f.attributes().count() )
105112
return false;
106113

0 commit comments

Comments
 (0)