Skip to content
Permalink
Browse files

Fix wrong mapping of feature ids in offline editing

Fix #14727
  • Loading branch information
m-kuhn committed Jun 22, 2016
1 parent acc8274 commit 216623ffe02f16e98db63799c10da1f7063e2537
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsofflineediting.cpp
@@ -661,11 +661,11 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
// Check if the online feature has been fetched (WFS download aborted for some reason)
if ( i < offlineFeatureIds.count() )
{
addFidLookup( db, layerId, offlineFeatureIds.at( i ), remoteFeatureIds.at( remoteCount - ( i + 1 ) ) );
addFidLookup( db, layerId, offlineFeatureIds.at( i ), remoteFeatureIds.at( i ) );
}
else
{
showWarning( QString( "Feature cannot be copied to the offline layer, please check if the online layer '%1' is sill accessible." ).arg( layer->name() ) );
showWarning( tr( "Feature cannot be copied to the offline layer, please check if the online layer '%1' is still accessible." ).arg( layer->name() ) );
return nullptr;
}
emit progressUpdated( featureCount++ );

8 comments on commit 216623f

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 22, 2016

@elpaso
Since you also work(ed) with offline editing, can you make sure that this still works for you? Just want to be sure that this didn't introduce other problems.

@elpaso

This comment has been minimized.

Copy link
Contributor

@elpaso elpaso replied Jun 24, 2016

@m-kuhn
It looks good to me. I tested it in postgis and it works well.
WFS-T is completely broken anyway (except for INSERT), working on that with @rouault

I wonder why the original implementation was iterating backward on remote features ids ...

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 24, 2016

@jef-n

This comment has been minimized.

Copy link
Member

@jef-n jef-n replied Jun 24, 2016

Non persistent fids are probably the cause of #14196 too.

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 26, 2016

I don't think we are able to make these fids persistent (are we?).

  • For offline editing, we could link the real pk obtained through QgsVectorDataProvider::pkAttributeIndexes() to the feature id for reverse lookup when sync'ing back.
  • For the server ( #14196), would we need to put it into shared memory (for concurrent processes) or even keep it on the hard drive (e.g. in a sqlite db)?
@drenton1

This comment has been minimized.

Copy link

@drenton1 drenton1 replied Jun 28, 2016

Just tested this with June 27 QGIS Weekly and works good with PostGIS layer.

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 28, 2016

Thanks for the feedback!

@elpaso

This comment has been minimized.

Copy link
Contributor

@elpaso elpaso replied Jun 30, 2016

@m-kuhn I've added a test for WFS offline editing #3258 can you please have a look?

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