Problem/Motivation

Currently, you can't install Matomo in Drupal 10 installation.

Steps to reproduce

Try to install the module in Drupal 10 with Composer, and see that it fails:

$ composer require -n drupal/matomo
[...]
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires drupal/matomo ^1.14 -> satisfiable by drupal/matomo[1.14.0, 1.x-dev].
    - drupal/matomo[1.14.0, ..., 1.x-dev] require drupal/core ^8.8.0 || ^9.0.0 -> found drupal/core[8.8.0-alpha1, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.4.x-dev] but the package is fixed to 10.0.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Proposed resolution

Add Drupal 10 under core_version_requirement in the matomo.info.yml file.

Remaining tasks

  • Add Drupal 10 as a core_version_requirement
  • Fix PHPUnit test errors and self deprecation notices:
    1) Drupal\Tests\matomo\Functional\AdminSettingsFormTest::testPageTracking with data set #2 ('/node/1\n/blog/*/view\nshop\n<front>', true) Failed asserting that false matches expected true.
    
      3x: The Drupal\Tests\matomo\Functional\AdminSettingsFormTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
        3x in DrupalListener::startTest from Drupal\Tests\Listeners

Issue fork matomo-3258071

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

ressa created an issue. See original summary.

ressa’s picture

Status: Active » Needs review
ressa’s picture

Title: Add Drupal 10 compatibility » Add Drupal 10 compatibility to Matomo
Issue summary: View changes
Status: Needs review » Needs work
grimreaper’s picture

Title: Add Drupal 10 compatibility to Matomo » [2.0.x] Drupal 10 compatibility
Parent issue: » #3252606: [X.0.x] Roadmap

This should be treated in #3252606: [X.0.x] Roadmap as D10 requires PHP 8.1 we will need a new major version.

grimreaper’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Assigned: Unassigned » grimreaper

Now that 2.0.x branch had been initialized I can finish this issue.

  • Grimreaper committed 3cf9eb1 on 2.0.x authored by ressa
    Issue #3258071 by ressa, Grimreaper: Drupal 10 compatibility and do a...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Fixed
ressa’s picture

Thanks! I can now download and install Matomo in Drupal 10.

grimreaper’s picture

You're welcome!

Thanks for your contributions and testing!

:)

Important note: you may want to fix the commit of the 2.0.x you are using as this branch will be used for the new architecture, stuff may break before update path is done.

ressa’s picture

Perfect, thanks for the heads up.

Status: Fixed » Closed (fixed)

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