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

Resource policies rptype is null after upgrading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.1, 5.2
    • Fix Version/s: 5.3, 6.0
    • Component/s: DSpace API
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      3
    • Documentation Status:
      Not Required

      Description

      We did an upgrade from 1.8 to 5_x and there is a trouble with the resourcepolicy table.

      When an item is withdrawn
      AuthorizeManager.removeAllPoliciesByDSOAndTypeNotEqualsTo(ourContext, this, ResourcePolicy.TYPE_CUSTOM);
      gets called, meaning the following sql gets executed
      DatabaseManager.updateQuery(c, "DELETE FROM resourcepolicy WHERE "
      + "resource_type_id= ? AND resource_id= ? AND rptype <> ? ",
      o.getType(), o.getID(), type);

      But since there was no rptype in 1.8, and the upgrade process does not add any, the column is null and nothing is deleted, because <> doesnt compare against null values.

      This actually means if there was an anonymous read on an item, the item is still visible after being withdrawn...

        Attachments

          Activity

            People

            Assignee:
            helix84 Ivan Masár
            Reporter:
            shark Ondřej Košarko
            Reviewer:
            Tim Donohue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: