gltn / stdm

STDM is a free and open source pro-poor land recordation system based on QGIS, PostgreSQL and PostGIS.
http://stdm.gltn.net/
GNU General Public License v2.0
30 stars 30 forks source link

Error Upon Loading the Entity Browser for a Spatial Entity #435

Closed gkahiu closed 3 years ago

gkahiu commented 3 years ago

I encounter an error when I select to load the browser for a spatial entity. See steps below for reproducing the issue:

  1. Select a spatial entity from the menu or toolbar image

  2. A stack trace is shown image

  3. Stack trace details:

    ValueError: invalid literal for int() with base 10: '' 
    Traceback (most recent call last):
    File "C:/Users/Kahiu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\stdm\ui\entity_browser.py", line 431, in showEvent
    self._initializeData()
    File "C:/Users/Kahiu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\stdm\ui\entity_browser.py", line 713, in _initializeData
    ordering = self.get_sorting_order(self._entity)
    File "C:/Users/Kahiu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\stdm\ui\entity_browser.py", line 855, in get_sorting_order
    sort_field = self.get_sorting_field(entity)
    File "C:/Users/Kahiu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\stdm\ui\entity_browser.py", line 873, in get_sorting_field
    cols[int(entity.updated_columns[k].row_index)] = k
    ValueError: invalid literal for int() with base 10: ''
nyalldawson commented 3 years ago

I can't reproduce this -- I suspect it's dependant on the configuration you're using.

Before proceeding, can you please test with fe7c37fe2f848007589bf9d4d374418eaa4e9ff1 and see if you get the exception? My suspicion is that this is a result of https://github.com/gltn/stdm/commit/3d932df194ac017414908b650d4778761a3a554d and is unrelated to the QGIS 3 port.