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

**URL:** <https://forum.getodk.org/t/collect-a-read-only-geoshape-is-able-to-be-edited/46218>\
**Category:** Support\
**Tags:** odk-collect\
**Created:** [April 7, 2024, 12:18pm UTC](https://forum.getodk.org/t/collect-a-read-only-geoshape-is-able-to-be-edited/46218 "2024-04-07T12:18:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahblake](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ahblake/32/22392_2.png) [@ahblake](https://forum.getodk.org/u/ahblake)\
**Post date:** [April 7, 2024, 12:18pm UTC](https://forum.getodk.org/t/collect-a-read-only-geoshape-is-able-to-be-edited/46218/1 "2024-04-07T12:18:59Z")

</div>

**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.

> <https://github.com/enketo/enketo/issues/375>
>
> But do not rush to implement this as it has never been requested.

> [@Making a question as READ-ONLY based on certain criteria](https://forum.getodk.org/t/making-a-question-as-read-only-based-on-certain-criteria/38136/9):
>
> Thanks for attempting, we hope to get there: Have you tried to do under calculate for the question, put this condition so that it preloads a YES, in addition to the condition I gave earlier, for the readonly question. if(${question1}='yes',"Yes","No")) Note: Ensure that the Values for Yes/No are the values in the choices sheet under name of the list group. Hope this works Thanks,

**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'

---

<div class="post-metadata">

**Author:** ![ahblake](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ahblake/32/22392_2.png) [@ahblake](https://forum.getodk.org/u/ahblake)\
**Post date:** [April 16, 2024, 6:38am UTC](https://forum.getodk.org/t/collect-a-read-only-geoshape-is-able-to-be-edited/46218/2 "2024-04-16T06:38:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [April 16, 2024, 3:23pm UTC](https://forum.getodk.org/t/collect-a-read-only-geoshape-is-able-to-be-edited/46218/3 "2024-04-16T15:23:23Z")

</div>

@wkobus also ran into this one and we're working on a fix: [https://github.com/getodk/collect/issues/6096](https://github.com/getodk/collect/issues/6096) Sorry about that, it's a bug.
