Convert views_test_data.module to OOP and remove it

Created on 15 July 2025, 2 months ago

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

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Postponed on πŸ“Œ Convert function_exists() to is_callable() Active

    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?

  • Merge request !12721Convert views_test_data.module β†’ (Open) created by nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • Pipeline finished with Success
    2 months ago
    Total: 688s
    #547451
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    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

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    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.

Production build 0.71.5 2024