colouring-cities / colouring-core

The Core Platform for the Colouring Cities Research Programme (CCRP)
https://colouringcities.org
GNU General Public License v3.0
48 stars 43 forks source link

Bug: building_id=0 is not callable and editable via frontend or API / t.building.verified is undefined #1321

Open traveller195 opened 9 months ago

traveller195 commented 9 months ago

@tomalrussell @mdsimpson42 @polly64 @popcorndoublefeature @blaumiau It is not possible to edit building with building_id=0 in Colouring Cities

Describe the problem Building having building_id = 0 is existing in the dataset (compare to database table 'buildings') but not included to API and frontend. It will be shown in the map, but a click to it (or try to open /view/age/0 in browser URL) leads to white screen. Zero is different to all other not existing building_ids like -1; -2 etc.

call https://colouringlondon.org/view/age/0 leads to white screen /

grafik

grafik

but https://colouringlondon.org/view/age/-1 other not existing building_ids are handled correctly grafik

Also a click to building no. 0 in the map of Colouring Dresden brings to same broken behaviour and a white screen.

More information The problem is existing in Colouring Core/London and Dresden, at least. I found out, because last year I did some bulk uploads e.g. for centroid lat/lon for all buildings. And now while analysing data extract of Colouring Dreden, I found out there is a building with building_id = 0 having now other builiding attributes.

for PostgreSQL databases, zero-based index is standard for rows in database tables.

possible solution allow also zero-based index for building_id in API could solve it.

matkoniecz commented 9 months ago

allow also zero-based index for building_id in API could solve it.

that would be ideal

I guess next step would be tracing where it fails. Is 0 treated as null somewhere?

Another option would be configuring indexing so 0 is not assigned but that is hacky at best.

polly64 commented 8 months ago

@matkoniecz do we need help with this or to address this- Need null values for stories, can you edit coloured tag thanks