#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()
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Move-file-related-hooks-to-new-api.php-file-2307853-8.patch | 15.39 KB | Palashvijay4O |
| #1 | 2307853.patch | 21.35 KB | jhodgdon |
Comments
Comment #1
jhodgdonHere's a patch.
Comment #2
jhodgdonNote 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.
Comment #5
jhodgdonOK. 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:
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.
Comment #6
Palashvijay4O commentedComment #7
pushpinderchauhan commentedPlease review attached patch.
Comment #8
Palashvijay4O commentedA patch .
Comment #9
jhodgdonThanks -- looks like both of you created the same patch! Committed to 8.0.x.