Problem/Motivation
#3495943: Handle module preprocess functions as OOP hooks Preprocess is in!
There are some test .module files that can likely be deleted.
The only thing in them is a helper function for the hooks that were converted.
To keep the conversion more consistent most of these were left alone.
This issue is to review them and delete them if possible.
Steps to reproduce
Review modules in test directories.
Review .inc and .module files
Proposed resolution
Review modules listed in the remaining tasks, create an issue and address the .module file.
At the same time if there is a .inc file see if that can be moved too.
Preprocess functions can be converted using the #[Preprocess] attributed. See #[3522114]
If hooks were missed they can be converted too.
If converting remaining hooks name the file according to: #[3493453]
Add dependency injection.
Update baseline if necessary.
Remaining tasks
Test modules with helpers
These modules can have the functions moved somewhere most likely and then the .module file deleted.
- config_import_test #3494121: Move helpers in config_import_test.module and delete it
- contact_storage_test #3494128: Move helpers in contact_storage_test.module and delete it
- content_translation_test #3494372: Move helpers in content_translation_test.module and delete it
- field_test: several #3494130: Move helpers in field_test.module and delete it
- field_ui_test #3494373: Move helpers in field_ui_test.module and delete it
- file_test: several #3495499: Move helpers in file_test.module and delete it
- image_module_test #3494673: Move helpers and hooks in a couple of test modules
- language_test #3494673: Move helpers and hooks in a couple of test modules
- node_access_test #3495214: Move helpers in node_access_test.module and delete it
- options_test #3495429: Move helpers in options_test.module and delete it
- ajax_forms_test: several #3495959: Move helpers out of ajax_forms_test.module and delete the file
- batch_test #3496887: Move helpers in batch_test.module and delete it
- entity_test: several #3495963: Move helpers in entity_test.module
- experimental_module_dependency_test #3497774: Delete experimental_module_dependency_test.module it is not used
- form_test #3495514: Move helpers in form_test.module and delete it
- hold_test #3495574: Move helpers in hold_test.module and delete it
- menu_test #3495577: Move helpers in menu_test.module and delete it
- system_test #3495615: Move helpers in system_test.module and delete it
- views_test_config, views_test_query_access #3495630: Move helpers in views_test_config.module, views_test_query_access.module and delete them
- workflow_type_test #3495638: Move helpers in workflow_type_test.module and delete it
Missed hooks
These test modules have hooks that should have been converted
- Missed hook: ckeditor5_drupalelementstyle_test #3499233: Manually convert ckeditor5_drupalelementstyle_test_ckeditor5_plugin_info_alter
- Missed hook: jsonapi_test_field_filter_access, layout_builder_extra_field_test, media_library_form_overwrite_test #3499234: Manually convert test modules hooks
- Missed hook: unversioned_assets_test #3498073: Manually convert unversioned_assets_test_library_info_alter
Evaluate
These were mostly postponed due to preprocess, some are testing procedural hook functionality, move them below.
- layout_builder_test #3522114: Convert layout_builder_test and remove .module file
- layout_builder_theme_suggestions_test #3522120: Convert layout_builder_theme_suggestions_test and remove .module
- common_test #3522216: Convert common_test hooks and delete .module
- media_test_embed #3529293: Convert several test modules and remove .module files [1]
- media_test_oembed #3529293: Convert several test modules and remove .module files [1]
- navigation_test #3529293: Convert several test modules and remove .module files [1]
- search_embedded_form #3529293: Convert several test modules and remove .module files [1]
- js_displace #3529293: Convert several test modules and remove .module files [1]
- olivero_test #3533049: Bulk convert the remaining hooks to OOP
- pager_test #3533049: Bulk convert the remaining hooks to OOP
- router_test #3533049: Bulk convert the remaining hooks to OOP
- theme_region_test #3533049: Bulk convert the remaining hooks to OOP
- theme_test #3518903: Convert template preprocess in system.module
- twig_theme_test #3535675: Remove twig_theme_test.module
- toolbar_test #3533049: Bulk convert the remaining hooks to OOP
- views_test_data #3535948: Convert views_test_data.module to OOP and remove it
- views_test_rss #3533049: Bulk convert the remaining hooks to OOP
- layout_test #3518903: Convert template preprocess in system.module
Postponed
These test .module loading or procedural hooks.
- Missed hook: deprecation_test #3499569: Manually convert deprecation_test.module functions to OOP
- Postponed: hook_collector_on_behalf_procedural
- Postponed: hook_collector_skip_procedural
- Postponed: hook_collector_skip_procedural_attribute
- Postponed: module_test
- Postponed: module_autoload_test
- Postponed: legacy_hook_test
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Issue fork drupal-3488051
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:
- 3488051-post-oop-hook
changes, plain diff MR !10220
Comments
Comment #2
nicxvan commentedComment #4
nicxvan commentedComment #5
nicxvan commentedComment #6
nicxvan commentedComment #7
nicxvan commentedComment #8
nicxvan commentedComment #9
nicxvan commentedComment #10
nicxvan commentedComment #11
nicxvan commentedComment #12
nicxvan commentedComment #13
nicxvan commentedComment #14
nicxvan commentedComment #15
nikolay shapovalov commentedComment #16
nikolay shapovalov commentedComment #17
nicxvan commentedComment #18
nikolay shapovalov commentedComment #19
nikolay shapovalov commentedComment #20
nikolay shapovalov commentedComment #21
nikolay shapovalov commentedComment #22
nikolay shapovalov commentedComment #23
nikolay shapovalov commentedComment #24
nikolay shapovalov commentedComment #25
nikolay shapovalov commentedComment #26
nikolay shapovalov commentedComment #27
nikolay shapovalov commentedComment #28
nicxvan commentedComment #29
nicxvan commentedComment #30
nicxvan commentedComment #32
nikolay shapovalov commentedComment #33
nikolay shapovalov commentedComment #34
nikolay shapovalov commentedComment #35
nikolay shapovalov commentedComment #36
nicxvan commentedComment #37
nicxvan commentedThat's the last of them until preprocess gets in: #3495943: Handle module preprocess functions as OOP hooks
Comment #38
nicxvan commentedComment #39
nicxvan commentedComment #40
nicxvan commentedComment #41
nicxvan commentedComment #42
nicxvan commentedComment #43
nicxvan commentedComment #44
nicxvan commentedComment #45
berdirComment #46
berdirComment #47
berdirOnly two actionable test modules left without issue, twig_theme_test I'd say is soft postponed on the system.module one as it will conflict with that (we could remove the comment fix from it, then it would not) and views_test_data. I suspect that one will run into some weird edge cases with views module and its dynamically defined theme infos + template_preprocess. I think we can either include that in the template_preprocess issue for views.module or do it in a follow-up of that.
I'd suggest we then mark this as fixed, and maybe open both a D12 and a D13 issue to start collecting the respective BC layers that we can remove in the respective major version including their tests. module_test.module for example has a hook_hook_info () (and a function that's been dead code for many years), so that can go in D12.
Comment #48
berdirComment #49
nicxvan commentedI created the issue for views_test_data #3535948: Convert views_test_data.module to OOP and remove it
We can convert that here and figure out if there is anything weird going on.
Your second paragraph is probably right, but let's think about it for a bit.