Problem/Motivation

jQuery.trim() is deprecated in jQuery 3.5 and has been removed from jQuery 4. matomo.admin.js still uses jQuery.trim().

Steps to reproduce

  • In Drupal 11.2
  • Access /admin/config/system/matomo
  • Open "Tracking scope" vertical tab "Roles"
  • Check any role
  • See JavaScript error in console
    Uncaught TypeError: $.trim is not a function

Proposed resolution

Use text.trim() instead of $.trim(text).

Issue fork matomo-3537364

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

hosterholz created an issue. See original summary.

hosterholz’s picture

Status: Active » Needs review
hosterholz’s picture

The Pipeline failed because

The string "/matomo/js/matomo.js" was not found anywhere in the HTML response of the current page.

The path to the script is /web/modules/custom/matomo-3537364/js/matomo.js, so this test cannot succed in issue pipelines. See Issue #3511606.

lmoeni’s picture

Status: Needs review » Reviewed & tested by the community

I tested the merge request and it fixes the described error.

mmbk’s picture

This patch is nearly identically to https://www.drupal.org/project/matomo/issues/3533416 except the fact, that #3533416 cleans up the MatomoAdminSettingsForm.php a bit.

I cannot decide which of these tickets to close as duplicate.

mmbk’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

#3533416 handles D11 deprecation and should be used

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

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

Maintainers, please credit people who helped resolve this issue.

hosterholz’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

#3533416 does not handle a Drupal 11 deprecation, but introduces a regression. So i reopen this one.

grimreaper’s picture

Assigned: Unassigned » grimreaper

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Reviewed & tested by the community » Fixed

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.