huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
242 stars 80 forks source link

Validation failed to delete _Geolocations_ property #3503

Open mylaa opened 3 years ago

mylaa commented 3 years ago

In one of Uwazi instances, the template ''Country'' has a ''Geolocation'' property. Values have been added to each country entity. ''Country'' template is being used via relationships across multiple other templates.

When deleting the ''geolocation'' property, the system throws an error message.

  1. Login to the instance
  2. Select Country template, delete ''Geolocation''
  3. System throws a notification to Confirm Deletion: Deleting a template property will delete this metadata information on all documents using this template. Change will take effect after saving the template.
  4. Confirm, by clicking ''delete property''
  5. Click save
  6. System throws an error message: _validation failed: .properties.geolocationgeolocation Can't delete properties being inherited.

Please reach out if you need to know the exact instance.

txau commented 3 years ago

@mylaa I guess this is working as intended. In Uwazi instead of cascading the field deletion, it enforces information integrity. You need to first delete the property where it is being inherited (on the other templates). Then you can delete the actual property.

Please try it out and let me know if it worked.

mylaa commented 3 years ago

@txau you are absolutely correct. I forgot to mention that the property is not being inherited in any template.

txau commented 3 years ago

@txau you are absolutely correct. I forgot to mention that the property is not being inherited in any template.

Oh, I see. In that case it may be a bug =)