fix(spp_farmer_registry_vocabularies): correct holder type namespace URI#158
fix(spp_farmer_registry_vocabularies): correct holder type namespace URI#158
Conversation
The holder type vocabulary used urn:fao:wca:2020:holder-type but the farm_details model and views filter on urn:openspp:vocab:holder-type, causing the Holder Type dropdown to show no records.
There was a problem hiding this comment.
Code Review
This pull request updates the namespace URI for 'Holder Type' from an FAO-specific URN to an OpenSPP-specific URN in both the documentation and the XML data. Feedback suggests updating the README summary for consistency and addressing the 'noupdate="1"' attribute in the XML to ensure the change is applied to existing installations.
| - Both | ||
|
|
||
| #### Holder Type (`urn:fao:wca:2020:holder-type`) | ||
| #### Holder Type (`urn:openspp:vocab:holder-type`) |
There was a problem hiding this comment.
While updating this URI, please also update the summary section at the beginning of the README (lines 12 and 16) to move 'holder types' from the FAO WCA 2020 list to the OpenSPP-specific list. This will maintain consistency with the new urn:openspp:vocab namespace and the other OpenSPP-specific vocabularies.
| #### Holder Type (`urn:openspp:vocab:holder-type`) | |
| #### Holder Type (urn:openspp:vocab:holder-type) |
| <record id="vocab_holder_type" model="spp.vocabulary"> | ||
| <field name="name">Holder Type (FAO WCA 2020)</field> | ||
| <field name="namespace_uri">urn:fao:wca:2020:holder-type</field> | ||
| <field name="namespace_uri">urn:openspp:vocab:holder-type</field> |
There was a problem hiding this comment.
The change to the namespace URI is correct. However, because this record is within an block (line 2), the update will not be applied to existing installations during a module upgrade. Since this is a system vocabulary (is_system="True"), you should consider removing the noupdate="1" attribute or providing a migration script to ensure the fix is applied automatically to all environments, avoiding the need for manual intervention as mentioned in the PR description.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #158 +/- ##
==========================================
- Coverage 71.33% 71.33% -0.01%
==========================================
Files 932 932
Lines 54975 54976 +1
==========================================
Hits 39217 39217
- Misses 15758 15759 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Why is this change needed?
The Holder Type dropdown in the Farmer Registry Farm Details tab shows no records. The vocabulary data was created with namespace
urn:fao:wca:2020:holder-typebut the model field and view domain filter onurn:openspp:vocab:holder-type, causing a mismatch.How was the change implemented?
Changed the namespace URI in
vocab_holder_type.xmlfromurn:fao:wca:2020:holder-typetourn:openspp:vocab:holder-typeto match the domain filter inspp_farmer_registry. Updated README.md accordingly.New unit tests
N/A — data-only change.
Unit tests executed by the author
Existing spp_farmer_registry tests pass.
How to test manually
spp_farmer_registryon a fresh instance (or update the vocabulary namespace manually on existing instances)Note: Since the XML uses
noupdate="1", existing instances need manual update: Settings > Vocabularies > find "Holder Type (FAO WCA 2020)" > change namespace tourn:openspp:vocab:holder-type.Related links
https://projects.acn.fr/projects/acn-eng/work_packages/833