Error after updating from 2.0 to 2.1

Created on 6 November 2024, 9 days ago

Problem/Motivation

After upgrading the module from version 2.0 to 2.1 using Composer, when trying to run Drush in the console, an error occurs:

"PHP Fatal error: Class Drupal\flags_country\Controller\CountryFlagAutocompleteController cannot extend final class Drupal\country\Controller\CountryAutocompleteController in ../web/modules/contrib/flags/flags_country/src/Controller/CountryFlagAutocompleteController.php on line 17

Fatal error: Class Drupal\flags_country\Controller\CountryFlagAutocompleteController cannot extend final class Drupal\country\Controller\CountryAutocompleteController in ../web/modules/contrib/flags/flags_country/src/Controller/CountryFlagAutocompleteController.php on line 17
[warning] Drush command terminated abnormally."

Steps to reproduce

- Run "composer require 'drupal/country:^2.1'"
- Run "drush cr"

๐Ÿ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡ฑPoland Alexius

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

Merge Requests

Comments & Activities

  • Issue created by @Alexius
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands batigolix Utrecht

    So this error comes from the Flags module which cannot extend the CountryFlagAutocompleteController class anymore since a recent change in the County module.

    I guess we should not have defined the CountryAutocompleteController as final class in the country module.

    This needs a bit more research.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States w01f

    I am seeing this on a site recently updated to 10.3.7 and using both country and flags modules. The php_errorlog file shows the following error:

    [09-Nov-2024 10:44:22 Asia/Tokyo] PHP Fatal error: Class Drupal\flags_country\Controller\CountryFlagAutocompleteController cannot extend final class Drupal\country\Controller\CountryAutocompleteController in /home/customer/www/kobejet.com/web/modules/contrib/flags/flags_country/src/Controller/CountryFlagAutocompleteController.php on line 0

    Flags (Flags Country) version 2.0.0-alpha1
    Country version 2.1.0

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    nilesh.addweb โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    Yes, @batigolix. I removed the final keyword from CountryAutocompleteController.php as itโ€™s extended by CountryFlagAutocompleteController.php in the flags_country module.

    Actually, this issue originates from #3458116 ๐Ÿ“Œ Make code pass the gitlab pipeline Fixed . We've made some adjustments to pass the GitLab pipeline.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States w01f

    Confirming removing "final" line 15 in /src/Controller/CountryAutocompleteController.php file allows the site to correctly run drush updb/cr or run update.php from the site again.

Production build 0.71.5 2024