task: #3608373 Convert the procedural hooks and helpers to OOP hook classes in the Varbase Media module

Converts all procedural hooks and shared helper functions in the Varbase Media module to a Drupal 11 object-oriented hook class using the #[Hook] attribute (change record), with all required services injected via the constructor (request stack, module handler, entity type manager, entity repository, renderer, current user, route match, language manager, theme manager, file URL generator, config factory/manager, and the media oEmbed services). The bulk-upload submit callback is a class method referenced via [$this, 'method'] with DependencySerializationTrait.

Removes varbase_media.module, includes/helpers.inc and varbase_media.tokens.inc; the one update-hook caller in includes/updates/v8.inc is rewired to the service.

Related issue: #3608373

What changed

All 21 hooks + token_info/tokens + the 6 utility helpers → \Drupal\varbase_media\Hook\VarbaseMediaHooks. Removed the 3 procedural files.


This changeset was produced with AI assistance (Claude Code). Per the Drupal AI-generated contribution policy, it has been reviewed by a human before submission.

Checkpoints

  • File an issue about this project
  • Addition/Change/Update/Fix to this project
  • Testing to ensure no regression
  • Automated unit/functional testing coverage
  • Developer Documentation support on feature change/addition
  • User Guide Documentation support on feature change/addition
  • UX/UI designer responsibilities
  • Accessibility and Readability
  • Reviewed by a human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Update Release Notes
  • Release
Edited by Rajab Natshah

Merge request reports

Loading