planetfederal / qgis-geogiglight-plugin

GNU General Public License v2.0
19 stars 9 forks source link

Different NULL representations for local and remote/original in "merge conflicts" dialog (causing python error) #41

Closed gioman closed 8 years ago

gioman commented 8 years ago

See the following screenshot

screenshot from 2016-07-27 13-46-35

as you can see I'm trying to resolve a (geometry) conflict for a feature that has attributes that are all "NULL". The representation for the "local" state in coherent with the representation in QGIS table of attributes, remote/original are "empty" so the representation is not coherent.

This would seems just cosmetic, in fact If I just resolve the conflict by choosing the solve with remote/local/merged it seems to work ok (without manually selecting any attribute from local/remote).

But... if select a few attributes from local/remote (even if is all NULL/empty) then on subsequent "solved with merged features" it returns a python error, that seems directly related to NULLs

TypeError: NULL is not JSON serializable

Traceback (most recent call last):
  File "C:/Users/qgis/.qgis2/python/plugins\geogig\layeractions.py", line 130, in _syncLayer
    if syncLayer(layer):
  File "C:/Users/qgis/.qgis2/python/plugins\geogig\tools\gpkgsync.py", line 110, in syncLayer
    conflict.resolveWithNewFeature(resolution)
  File "C:/Users/qgis/.qgis2/python/plugins\geogig\geogigwebapi\diff.py", line 92, in resolveWithNewFeature
    self.localCommit, self.transactionId)
  File "C:/Users/qgis/.qgis2/python/plugins\geogig\geogigwebapi\repository.py", line 416, in resolveConflictWithFeature
    r = requests.post(self.url + "repo/mergefeature", json = payload)
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\api.py", line 111, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\sessions.py", line 461, in request
    prep = self.prepare_request(req)
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\sessions.py", line 394, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\models.py", line 298, in prepare
    self.prepare_body(data, files, json)
  File "C:\Users\qgis\.qgis2\python\plugins\geogig\ext-libs\requests-2.10.0-py2.7.egg\requests\models.py", line 424, in prepare_body
    body = complexjson.dumps(json)
  File "C:\PROGRA~1\BOUNDL~1\Desktop\osgeo4w\apps\Python27\lib\site-packages\simplejson\__init__.py", line 354, in dumps
    return _default_encoder.encode(obj)
  File "C:\PROGRA~1\BOUNDL~1\Desktop\osgeo4w\apps\Python27\lib\site-packages\simplejson\encoder.py", line 262, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\PROGRA~1\BOUNDL~1\Desktop\osgeo4w\apps\Python27\lib\site-packages\simplejson\encoder.py", line 340, in iterencode
    return _iterencode(o, 0)
  File "C:\PROGRA~1\BOUNDL~1\Desktop\osgeo4w\apps\Python27\lib\site-packages\simplejson\encoder.py", line 239, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: NULL is not JSON serializabl