Problem/Motivation

We are working on a drupal 9 to 10 upgrade. Still preparing so our site using Drupal 9 actually.
Installed XML sitemap version: XML Sitemap 8.x-1.5 which is the latest stable and theoretically compatible with Drupal 10 but
upgrade status module notifies me the following errors (not warnings):

tests/src/Functional/XmlSitemapFunctionalTest.php
line: 36
Call to deprecated method drupalGetHeader() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->getResponseHeader() instead.

tests/src/Functional/XmlSitemapFunctionalTest.php
line. 37
Call to deprecated method drupalGetHeader() of class Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->getResponseHeader() instead.

tests/src/Functional/XmlSitemapFunctionalTest.php
line:67
Call to deprecated function taxonomy_term_load_multiple_by_name(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['name' => $name, 'vid' => $vid]) instead, to get a list of taxonomy term entities having the same name and keyed by their term ID.

xmlsitemap.module
line: 2351
Call to deprecated method getImplementations() of class Drupal\Core\Extension\ModuleHandlerInterface. Deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Instead you should use ModuleHandlerInterface::invokeAllWith() for hook invocations or you should use ModuleHandlerInterface::hasImplementations() to determine if hooks implementations exist.

Was already fixed in #3323148: Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations() in xmlsitemap_check_status()

Errors #1-3 are related to test so probably doesn't affects daily usage of module but the #4 is related to the xmlsitemap.module so I think It may require attention

Issue fork xmlsitemap-3390909

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kepesv created an issue. See original summary.

bobi-mel’s picture

Assigned: Unassigned » bobi-mel
sarwan_verma’s picture

StatusFileSize
new1.94 KB

Hi @kepesv,
I have fixed this issue Drupal 10 compatibility - Call to deprecated method getImplementations() of class Drupal\Core\Extension\ModuleHandlerInterface and also attached patch.
please review and verify.

sarwan_verma’s picture

Assigned: bobi-mel » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: Drupal10_compatibility-3390909.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

pradhumanjain2311’s picture

Status: Needs work » Needs review
StatusFileSize
new1.95 KB

Try to fix failed test case.

ankondrat4 made their first commit to this issue’s fork.

ankondrat4’s picture

Hello.

Refactor and created MR.

Please review.

dww made their first commit to this issue’s fork.

dww’s picture

Version: 8.x-1.5 » 8.x-1.x-dev

Confirmed. Ran into this on a client project where I'm trying to upgrade a site from 8.9.x to modern Drupal. An intermediate step is getting from D9 to D10, and that requires the 8.x-1.x branch. That branch doesn't fully work with D10, even though the .info.yml file says so.

I rebased the MR on the latest 8.x-1.x, and pushed a commit to get the tests passing on both branches (at least locally).

Note that #3365229: Add separate 'Save' and 'Save and add fields' to Add Content, Comment, Media and Block Type Forms somewhat annoyingly (and IMHO, out of scope) changed the button label on the content type form from 'Save content type' to just 'Save'. That's why we need the version_compare() in XmlSitemapMultilingualNodeTest.php.

poker10’s picture

Title: Drupal 10 compatibility - Call to deprecated method getImplementations() of class Drupal\Core\Extension\ModuleHandlerInterface. Deprecated » Additional Drupal 10 compatibility fixes - drupalGetHeader() / taxonomy_term_load_multiple_by_name() / watchdog_exception()
Issue summary: View changes

Thanks for your patience. I have reviewed the changes from the MR and it looks good. Updating the title, credits and going to merge this.

  • poker10 committed 6b6c0560 on 8.x-1.x authored by ankondrat4
    fix: #3390909 Additional Drupal 10 compatibility fixes - drupalGetHeader...
poker10’s picture

Issue summary: View changes
Status: Needs review » Fixed

This is now merged into 8.x-1.x. Thanks everyone!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.