#2299715: [meta] Move core hooks from system.api.php to core.api.php or other files made an inventory of hooks currently documented in core/modules/system/system.api.php.

There were several related to files. They should be moved into a new core/modules/systemfile.api.php file.

Here's the list (suggested to put them into the file in this order):
hook_stream_wrappers(), hook_stream_wrappers_alter()
hook_file_download(), hook_file_url_alter()
hook_file_mimetype_mapping_alter()
hook_archiver_info_alter()
hook_filetransfer_info(), hook_filetransfer_info_alter()

Comments

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new21.35 KB

Here's a patch.

jhodgdon’s picture

Note on this patch:
- The hooks/documentation were copied/pasted directly.
- The only new parts are the @file and @addtogroup blocks at the top of file.api.php.

So, to review:
a) Did I delete the right hooks from system.api.php
b) Did I add them to file.api.php
c) Was this a good choice to group them together in a new file.api.php. The idea is that they are not related to the System module per se, so they should not be in system.api.php.

jhodgdon queued 1: 2307853.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1: 2307853.patch, failed testing.

jhodgdon’s picture

Issue tags: +Novice

OK. I would like to ask, as a Novice task, that someone please make this patch again.

What you need to do is start over, rather than doing a classic "patch reroll":

a) Make a new file called core/modules/system/file.api.php

b) Put this into the file:

<?php

/**
 * @file
 * Hooks related to the File management system.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * @} End of "addtogroup hooks".
 */

c) Between those two lines, move in the following file-related hooks that are currently in system.api.php:
hook_stream_wrappers_alter()
hook_file_download()
hook_file_url_alter()
hook_file_mimetype_mapping_alter()
hook_archiver_info_alter()
hook_filetransfer_info()
hook_filetransfer_info_alter()

Note: You need to copy/paste the current hooks from system.api.php rather than trying a reroll, so that we get the existing hook functions and documentation and not the older version that was in this patch.

Palashvijay4O’s picture

Assigned: Unassigned » Palashvijay4O
pushpinderchauhan’s picture

Status: Needs work » Needs review
StatusFileSize
new15.39 KB

Please review attached patch.

Palashvijay4O’s picture

StatusFileSize
new15.39 KB

A patch .

jhodgdon’s picture

Status: Needs review » Fixed

Thanks -- looks like both of you created the same patch! Committed to 8.0.x.

  • jhodgdon committed 57b92f2 on 8.0.x
    Issue #2307853 by er.pushpinderrana, Palashvijay4: Move file-related...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.