The old mysql version causes a problem while upgrading Drupal to version 9.5.

Created on 19 January 2023, almost 2 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

When upgrading Drupal to version 9.5, when we try to enter the module administration (/admin/config/search/media_sitemap) the following error occurs:

The website has encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\media_sitemap\Controller\MediaSitemapController:: __construct() must be an instance of Drupal\MysqlConnection, instance of Drupal\mysqlConnection given, called in /var/www/html/docroot/modules/contrib/media_sitemap/src/Controller/MediaSitemapController. php on line 51 in Drupal\media_sitemap\Controller\MediaSitemapController->__construct() (line 40 of modules/contrib/media_sitemap/src/Controller/MediaSitemapController.php).

This is because database drivers have been updated:
\Database driver is deprecated in drupal:9.4.0 and removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module. See https://www.drupal.org/node/3129492'

Proposed resolution

To fix this I have changed the references to:
Drupal\Core\Database\Driver\mysql\Connection
with the new module:
Drupal\mysql\Driver\Database\mysql\Connection

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇪🇸Spain ipitbiz

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work almost 2 years ago
  • Issue was unassigned.
  • Status changed to RTBC almost 2 years ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India imalabya Bangalore

    The patch doesn't apply

    error: while searching for:
          'field_infographic',
        ];
        // Get image files are being used by paragraph.
        $img_fids_by_paragraph = \Drupal::database()->select('file_managed', 'fm');
        $img_fids_by_paragraph->join('file_usage', 'fu', 'fu.fid = fm.fid');
        $img_fids_by_paragraph->fields('fu', array('fid', 'id'));
        $img_fids_by_paragraph->fields('fm', array('uri', 'filename'));
    
    error: patch failed: src/MediaSitemapGenerator.php:77
    error: src/MediaSitemapGenerator.php: patch does not apply
    
  • Status changed to Needs review over 1 year ago
Production build 0.71.5 2024