Use the magic method instead of "versionHistory" method from VersionHistoryController class

Created on 11 August 2023, 10 months ago
Updated 28 February 2024, 4 months ago

Problem/Motivation

We are receiving following error when I enable a module in Drupal 10.1.2.

he website encountered an unexpected error. Please try again later.

InvalidArgumentException: The controller for URI "" is not callable. in Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition() (line 71 of core/lib/Drupal/Core/Controller/ControllerResolver.php).
Drupal\webform_revision_ui\Controller\RevisionController->revisionOverview()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 70)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 53)
Asm89\Stack\Cors->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

The problem is that original patch https://www.drupal.org/comment/14289157#comment-14289157 had the method called versionHistory() in the VersionHistoryController.

In the subsequent patch updates, this method got replaced by magic method from the same controller.
So, I think we should directly use the magic method in RevisionController class.

Steps to reproduce

Install the module in Drupal 10.1.2
Visit the webform revisions path admin/structure/webform/manage/test/revisions
You'll notice the mentioned errors.

Proposed resolution

Use the magic method since original method is removed.
Patch is attached

Remaining tasks

Needs review

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India mohit_aghera Rajkot

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

Comments & Activities

Production build 0.69.0 2024