Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1995

Unexpected behavior when ingestDatastream is called for existing datastreams

    Details

      Description

      When ingesting a datastream via ingestDatastream (https://github.com/Islandora/tuque/blob/1.x/Object.php#L837-L870) on an object that already has that datastream Tuque returns a FALSE as opposed to throwing an exception. This gets propagated up in the tuque_wrapper by having the $ret being passed off to the datastream hooks (https://github.com/Islandora/islandora/blob/7.x/includes/tuque_wrapper.inc#L238-L240). That is any hooks expecting to deal with an FedoraDatastream would instead be getting a NewFedoraDatastream of a datastream that did not get ingested to the object.

      This behavior was found by having a module that was looking at a datastream's createdDate. Currently this behavior is triggered erroneously in core by the collection SP as it does not check for the TN being present before adding a default one (https://github.com/Islandora/islandora_solution_pack_collection/blob/7.x/islandora_basic_collection.module#L955-L960).

      Sample module / PRs to come.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jordandukart Jordan Dukart
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: