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 / Delete last point / Delete all points buttons are greyed out and unusable.
However, it is possible to drag vertices around and then save (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'