Navigation Menu

Skip to content

Commit

Permalink
Fix wrong mapping of feature ids in offline editing
Browse files Browse the repository at this point in the history
Fix #14727
  • Loading branch information
m-kuhn committed Jun 22, 2016
1 parent acc8274 commit 216623f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsofflineediting.cpp
Expand Up @@ -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++ );
Expand Down

8 comments on commit 216623f

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 216623f Jun 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

@elpaso elpaso commented on 216623f Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member Author

@m-kuhn m-kuhn commented on 216623f Jun 24, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jef-n
Copy link
Member

@jef-n jef-n commented on 216623f Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 216623f Jun 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 216623f Jun 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback!

@elpaso
Copy link
Contributor

@elpaso elpaso commented on 216623f Jun 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.