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

Setting embargo.field.terms to an unqualified field throws uncaught exception on item submission

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: DSpace API
    • Labels:
      None
    • Attachments:
      1
    • Comments:
      4
    • Documentation Status:
      Not Required

      Description

      Set the embargo.field.terms property in dspace.cfg to an unqualified field., e.g.

      embargo.field.terms = schema.field

      rather than

      embargo.field.terms = schema.field.qualifier

      Then when completing an item submission, an uncaught ArrayIndexOutOfBounds exception is throw by EmbargoManager. The stack trace sent back to the browser is:

      java.lang.ArrayIndexOutOfBoundsException: 2
      at org.dspace.embargo.EmbargoManager.getQualifierOf(EmbargoManager.java:412)
      at org.dspace.embargo.EmbargoManager.init(EmbargoManager.java:379)
      at org.dspace.embargo.EmbargoManager.getEmbargoDate(EmbargoManager.java:161)
      at org.dspace.content.InstallItem.installItem(InstallItem.java:94)
      [...]

      Untested, but a reasonable starting point would be to check for sa.length greater than 2, instead of 1 on line 412 of EmbargoManager. Note than line 405 has a similar problem (though less likely to show up) and that the comments for getElementOf and getQualifierOf methods are misleading.

        Attachments

          Activity

            People

            Assignee:
            lcs Larry Stone
            Reporter:
            shanrath Scott Hanrath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: