Problem/Motivation

.module files are no longer necessary, let's convert views_test_data.module

Steps to reproduce

Open file

Proposed resolution

Move all accessCallbacks to ViewsTestCallbacks
Move all template_preprocess functions to static callbacks in the hook class.

Remaining tasks

None

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-3535948

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

Postponed on #3520416: [meta] Handle calls to functions that still require .module file autoloading.

Views access callbacks cannot be OOP until that is changed. I will push up converting what I've done so far and change that function_exists to is_callable, but it exits in a child process.

I'm not sure where the template preprocess initial preprocess goes either.
template_preprocess_views_view_mapping_test is the template function, but there is no hook_theme for views_view_mapping_test. Is this meant to be just a

I see:

#[ViewsStyle(
  id: "mapping_test",
  title: new TranslatableMarkup("Field mapping"),
  help: new TranslatableMarkup("Maps specific fields to specific purposes."),
  theme: "views_view_mapping_test",
  display_types: ["normal", "test"],
)]

But I am not sure where to put this. Is this another that is meant to be just a normal preprocess?

nicxvan’s picture

Title: Convert views_test_data.module to OOP and remove it » [pp-1] Convert views_test_data.module to OOP and remove it
Status: Active » Postponed
berdir’s picture

This is testing the generic theme definitions in views module.

I think it makes sense to convert that there to verify it works for other modules

nicxvan’s picture

I'm ok with converting the preprocess there. It is the callbacks are postponed.

I just figured i would do both at once until I got the is callable issue.

nicxvan’s picture

Title: [pp-1] Convert views_test_data.module to OOP and remove it » Convert views_test_data.module to OOP and remove it
Status: Postponed » Needs work
Related issues: +#3539917: Deprecate access callback in HandlerBase

The issue this was postponed on became a META and the specific issue was resolved as a child issue.

This can be worked on now!

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.