Skip to content
Permalink
Browse files
[offline editing] fix overwriting of first field on remote layer when…
… it has virtual fields (#44999)
  • Loading branch information
3nids committed Sep 9, 2021
1 parent 4601394 commit e84f013adf35560c798b586bb7e6c36786c5c289
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/qgsofflineediting.cpp
@@ -1000,12 +1000,15 @@ void QgsOfflineEditing::applyFeaturesAdded( QgsVectorLayer *offlineLayer, QgsVec
{
// NOTE: SpatiaLite provider ignores position of geometry column
// restore gap in QgsAttributeMap if geometry column is not last (WORKAROUND)
QMap<int, int> attrLookup = attributeLookup( offlineLayer, remoteLayer );
const QMap<int, int> attrLookup = attributeLookup( offlineLayer, remoteLayer );
QgsAttributes newAttrs( newAttrsCount );
const QgsAttributes attrs = it->attributes();
for ( int it = 0; it < attrs.count(); ++it )
{
const int remoteAttributeIndex = attrLookup[ it ];
const int remoteAttributeIndex = attrLookup.value( it, -1 );
// if virtual or non existing field
if ( remoteAttributeIndex == -1 )
continue;
QVariant attr = attrs.at( it );
if ( remoteLayer->fields().at( remoteAttributeIndex ).type() == QVariant::StringList )
{

0 comments on commit e84f013

Please sign in to comment.