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.

Missed hooks

These test modules have hooks that should have been converted

Evaluate

These were mostly postponed due to preprocess, some are testing procedural hook functionality, move them below.

Postponed

These test .module loading or procedural hooks.

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

Command icon 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:

Comments

nicxvan created an issue. See original summary.

nicxvan’s picture

Issue summary: View changes

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Title: Post OOP hook conversion test module cleanup » [meta] Post OOP hook conversion test module cleanup
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes

nicxvan changed the visibility of the branch 3488051-post-oop-hook to hidden.

nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nikolay shapovalov’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
Status: Active » Postponed

That's the last of them until preprocess gets in: #3495943: Handle module preprocess functions as OOP hooks

nicxvan’s picture

Issue summary: View changes
Status: Postponed » Active
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
berdir’s picture

Issue summary: View changes
berdir’s picture

Issue summary: View changes
berdir’s picture

Only 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.

berdir’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes

I 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.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.