Problem/Motivation
See #3566536: [meta] eliminate core .module files
Proposed resolution
According to "Drupal core backend backwards compatibility and internal API policy", section Underscore-prefixed functions and methods
Functions or methods with an underscore prefix (e.g. _some_function()) are considered internal, and may be used to avoid name collisions when backporting protected methods critical or major bug fixes. Extending code should not call these functions or methods directly nor use the underscore prefix for added methods.
Move the following functions, as protected methods, to \Drupal\editor\Hook\EditorHooks and delete them in editor.module, without a replacement.
_editor_record_file_usage()->EditorHooks::recordFileUsage()_editor_delete_file_usage()->EditorHooks::deleteFileUsage()_editor_get_file_uuids_by_field()->EditorHooks::getFileUuidsByField()_editor_get_formatted_text_fields()->EditorHooks::getFormattedTextFields()_editor_parse_file_uuids()->EditorHooks::parseFileUuids()
Remaining tasks
None.
User interface changes
None.
Introduced terminology
None.
API changes
Underscore prefixed functions from editor.module are deleted.
Data model changes
None.
Issue fork drupal-3568101
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3568101-editor.module-underscore-fct
changes, plain diff MR !14386
Comments
Comment #3
claudiu.cristeaUpdate IS
Comment #4
claudiu.cristeaReady for review.
Comment #5
dcam commentedThe plan seems solid to me. There are no usages of these functions outside of the hook class. The change record looks good. I tested the hooks by adding entities with image files, editing them, deleting them, deleting revisions. Everything still works properly. LGTM.
Comment #7
claudiu.cristeaNeeds reroll
Comment #8
alexpottDiscussed with @catch and @longwave and @larowlan - we agreed we should just remove these methods in main and be done. The BC policy should be followed - they are not API - there are a couple of contrib usages but it's not super common.
Comment #9
nicxvan commentedWe can do that, in order to reduce decision fatigue since there are already .module files with 13 removals we thought we'd be consistent and just deprecate everything.
But if we want to just remove them we can.
We'll have to update a few of the issues if that is the direction.
Comment #10
claudiu.cristeaRemoved the underscore functions as per #8
Comment #11
dcam commentedAll declarations and usages of the underscored files have been deleted from Core. The recent changes look good.
Comment #12
claudiu.cristeaAs it was decided, I've added back the code but for removal in D12
Comment #13
alexpottCommitted 78087df and pushed to main. Thanks!
Committed 7a2ceed and pushed to 11.x. Thanks!
Note I removed the methods (and fixed the use statements) on the commit to main so there is no need for a follow-up issue to remove the code.