Drupal 10 PHP Fatal Error on install

Created on 27 February 2023, almost 2 years ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

I am trying to install TVI in Drupal 10, in order to show products by taxonomy term.

But when I try to install I get the following PHP error:

PHP Fatal error:  Declaration of Drupal\tvi\EventSubscriber\RouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /var/www/html/web/modules/contrib/tvi/src/EventSubscriber/RouteSubscriber.php on line 34

Steps to reproduce

Try to install the module in Drupal 10

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇦🇺Australia Andrew.Macpherson

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

Comments & Activities

  • Issue created by @Andrew.Macpherson
  • 🇮🇳India Adil_Siddiqui

    It is fixed in 2.0.x branch where we need to give getSubscribedEvents() : array instead of getSubscribedEvents() in RouteSubscriber.php.
    This change is not there in 2.0.0-alpha1 but it was present in 2.0.x-dev release

  • 🇦🇺Australia Andrew.Macpherson

    Thanks, Adil, for the quick reply and for clearing things up.

    It's good to know that this issue has a solution, but I'm never really comfortable going with dev releases unless absolutely necessary. Since I had already come up with a workaround of sorts, I will probably first wait a while to see if a new alpha, beta or stable release comes out.

    Thanks again, Andrew

  • 🇬🇧United Kingdom aesuk

    Any tips on how to proceed? I can't disable the module in the ui or in drush.

    - drush pm-unistall tvi
    "The following module(s) are not installed: tvi. No modules to uninstall."

    - Recent log messages shows
    "Schema information for module tvi was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, tvi_update_8000()."

    It's like it's half installed. But changing RouteSubscriber.php hasn't had much effect

  • 🇸🇮Slovenia KlemenDEV

    Is this in the release or still in dev?

  • Status changed to Closed: duplicate over 1 year ago
Production build 0.71.5 2024