Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vocabulary displayed-values aren't retrieved using the encoded stored-value in submission form #2724

Closed
alexandrevryghem opened this issue Dec 28, 2023 · 0 comments · Fixed by #2725
Assignees
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back component: submission
Milestone

Comments

@alexandrevryghem
Copy link
Member

Describe the bug
When a field that uses a vocabulary already contains a value (on page refresh or using item template), the displayed-value is retrieved by sending the stored-value to the backend. The problem is that this value isn't encoded, which means that it sometimes can't retrieve the correct displayed-value. This happens for example if your stored-value ends with a trailing slash.

To Reproduce
Steps to reproduce the behavior:

  1. Add this value-pairs to your submission-forms.xml:
    <value-pairs value-pairs-name="custom_rights" dc-term="type">
        <pair>
            <displayed-value>N/A</displayed-value>
            <stored-value></stored-value>
        </pair>
        <pair>
            <displayed-value>CC-BY-SA</displayed-value>
            <stored-value>https://creativecommons.org/licenses/by-sa/4.0/</stored-value>
        </pair>
        <pair>
            <displayed-value>CC-BY-NC</displayed-value>
            <stored-value>https://creativecommons.org/licenses/by-nc/4.0</stored-value>
        </pair>
    </value-pairs>
  2. Add this field to your submission form:
    <field>
        <dc-schema>dc</dc-schema>
        <dc-element>rights</dc-element>
        <repeatable>false</repeatable>
        <label>Rights</label>
        <input-type value-pairs-name="custom_rights">dropdown</input-type>
        <hint>Select the rights.</hint>
        <required></required>
    </field>
  3. Select CC-BY-SA and click save
  4. Refresh the page

Expected behavior
After refreshing the page you should still see CC-BY-SA in the dc.rights field, but now https://creativecommons.org/licenses/by-sa/4.0/ is being displayed instead

@alexandrevryghem alexandrevryghem added bug component: submission needs triage New issue needs triage and/or scheduling claimed: Atmire Atmire team is working on this issue & will contribute back labels Dec 28, 2023
@alexandrevryghem alexandrevryghem self-assigned this Dec 28, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Dec 28, 2023
@tdonohue tdonohue removed this from DSpace Backlog Jan 8, 2024
@tdonohue tdonohue removed the needs triage New issue needs triage and/or scheduling label Jan 8, 2024
@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Jan 8, 2024
@tdonohue tdonohue added this to the 7.6.2 milestone Feb 15, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DSpace 8.x and 7.6.x Maintenance May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back component: submission
Projects
Development

Successfully merging a pull request may close this issue.

2 participants