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

Function signature in function hook_islandora_derivative_alter makes Object a required argument?

    Details

      Description

      function hook_islandora_derivative_alter(&$derivatives, AbstractObject $object, $ds_modified_params = array()) at https://github.com/Islandora/islandora/blob/7.x/islandora.api.php#L749 does not define a default NULL value for AbstractObject, which in turn is optional (and defaulted to null) on hook_islandora_derivative/ it's older brother at: https://github.com/Islandora/islandora/blob/7.x/islandora.api.php#L666-L706

      In this particular context, the object is passed as an argument
      https://github.com/Islandora/islandora/blob/847f3dac6bdeb439a5d92b2c625826e8597bed89/includes/derivatives.inc#L305-L307 to be made.
      The same function could be used in an non specific object context.

      but most important, it makes https://github.com/Islandora/islandora_checksum/blob/7.x/islandora_checksum.module#L39-L52 specific islandora_checksum_islandora_derivative_alter to require an islandora Object, even when in that context Object is not used, not required.

        Attachments

          Activity

            People

            • Assignee:
              dpinokrayon Diego Pino Navarro
              Reporter:
              dpinokrayon Diego Pino Navarro
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: