Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2987

DescribeStep loses type-bind qualdrop fields

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      2

      Description

      DescribeStep loses some metadata values when two type-bound fields are configured in input-forms.xml for the same metadata, and one of them
      is a qualdrop.

      To reproduce this issue
      1) add the following fields and value-pair in the same form-page in input-forms.xml.
      2) add an item with type==Book , add a metadata value for dcterms.creator.author in "Creator Qualdrop" labeled field. (here the value is persisted in DB)
      3) go to the next step, (here the value is no longer in the DB)
      4) go back to the previous step (here "Creator Qualdrop" field will be empty)

      <field>
      <dc-schema>dcterms</dc-schema>
      <dc-element>creator</dc-element>
      <dc-qualifier></dc-qualifier>
      <repeatable>true</repeatable>
      <label>Creator Qualdrop</label>
      <type-bind>Book</type-bind>
      <input-type value-pairs-name="creator-role">qualdrop_value</input-type>
      </field>

      <field>
      <dc-schema>dcterms</dc-schema>
      <dc-element>creator</dc-element>
      <dc-qualifier>author</dc-qualifier>
      <repeatable>true</repeatable>
      <label>Author</label>
      <type-bind>Thesis</type-bind>
      <input-type>twobox</input-type>
      </field>

      <value-pairs value-pairs-name="creator-role" dc-term="creator-role">
      <pair>
      <displayed-value>Author</displayed-value>
      <stored-value>author</stored-value>
      </pair>
      <pair>
      <displayed-value>Compilator</displayed-value>
      <stored-value>compilator</stored-value>
      </pair>
      ...
      </value-pairs>

      I have checked the code and the problem seems to be in the "addBody" method from DescribeStep, in the qualdrop_value procesing section, when is filtering fields, doesn't have in consideration the type-bind of the field. The "isFieldPresent" method from DCInputSet class always find the named field in the current set, so always returns true, and the field is never filtered, so the value described early disapear from the form, and also from the DB

      If you want I can make a PR for this issue.

      Regards.

        Attachments

          Activity

            People

            Assignee:
            kevin van de velde Kevin Van de Velde (Atmire)
            Reporter:
            juanmanuelcata Juan Manuel Catá(SEDICI)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: