Collect: a read-only geoshape is able to be edited

1. What is the issue? Please be detailed.
I wanted to set a geoshape field to read only in certain cases, so used an expression in the read_only column to evaulate to true if I wanted it unchangeable.

When this expression evaulates correctly, the geoshape widget in Collect displays as View GeoShape and the Add points :round_pushpin: / Delete last point :negative_squared_cross_mark: / Delete all points buttons :wastebasket: are greyed out and unusable.

However, it is possible to drag vertices around and then save :floppy_disk: (which is not greyed out), and the geoshape is modified.

Similar behaviour exists for geotraces.

I have not tested: non dynamic read_only or geopoint.

I'm aware that dynamic read-only doesn't function in Enketo, but don't believe this is related as the geoshape button has changed to 'view' and some functions are blocked. Plus when it evaulates to false it doesn't intially change to 'View GeoShape' and no buttons are greyed out.

2. What steps can we take to reproduce this issue?

  • Set a geoshape/geotrace question to read only via an expression
  • Calculate in a default value with a trigger
  • Select 'View GeoShape' and then adjust the vertices and save.
    • Note that after saving the button now shows 'View or Change GeoShape', but entering the map view again doesn't enable add/remove points.
    • Changing screens and returning or saving as draft, exiting, reopening resets the button to 'View GeoShape' but the modified points remain and opening / modifying / saving will again revert the button to 'View or Change GeoShape'
1 Like

Has anyone been able to replicate this behaviour? Is it actually a Collect bug or was I seeing some unusual behaviour on my device?

@wkobus also ran into this one and we're working on a fix: Sorry about that, it's a bug.

1 Like