Skip to content

fix(spp_farmer_registry_vocabularies): correct holder type namespace URI#158

Open
emjay0921 wants to merge 1 commit into19.0from
fix/farmer-holder-type-namespace
Open

fix(spp_farmer_registry_vocabularies): correct holder type namespace URI#158
emjay0921 wants to merge 1 commit into19.0from
fix/farmer-holder-type-namespace

Conversation

@emjay0921
Copy link
Copy Markdown
Contributor

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-type but the model field and view domain filter on urn:openspp:vocab:holder-type, causing a mismatch.

How was the change implemented?

Changed the namespace URI in vocab_holder_type.xml from urn:fao:wca:2020:holder-type to urn:openspp:vocab:holder-type to match the domain filter in spp_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

  1. Install spp_farmer_registry on a fresh instance (or update the vocabulary namespace manually on existing instances)
  2. Go to Registry > Farms > open a farm > Farm Details tab
  3. Click the Holder Type dropdown — should now show: Individual, Joint, Institutional

Note: Since the XML uses noupdate="1", existing instances need manual update: Settings > Vocabularies > find "Holder Type (FAO WCA 2020)" > change namespace to urn:openspp:vocab:holder-type.

Related links

https://projects.acn.fr/projects/acn-eng/work_packages/833

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.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
#### 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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.33%. Comparing base (aaa9001) to head (b205aa5).

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
spp_base_common 90.26% <ø> (ø)
spp_farmer_registry 88.39% <ø> (ø)
spp_farmer_registry_cr 61.15% <ø> (ø)
spp_farmer_registry_demo 54.01% <ø> (ø)
spp_farmer_registry_vocabularies 39.40% <ø> (-0.14%) ⬇️
spp_irrigation 95.45% <ø> (ø)
spp_land_record 98.55% <ø> (ø)
spp_programs 62.23% <ø> (ø)
spp_security 66.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant