Don't hardcode html2canvas path in website_feedback_requirements()

Created on 28 July 2025, 8 days ago

Problem/Motivation

We use hook_library_info_alter() to alter the path of html2canvas but website_feedback_requirements() still complains it can't find it at the original path.

Steps to reproduce

Add this kind of hook:

/**
 * Implements hook_library_info_alter().
 */
function foo_library_info_alter(array &$libraries, string $extension): void {
  if ($extension == 'website_feedback') {
    $libraries['html2canvas']['js']['/foo/html2canvas.min.js'] = $libraries['html2canvas']['js']['/libraries/html2canvas/html2canvas.min.js'];
    unset($libraries['html2canvas']['js']['/libraries/html2canvas/html2canvas.min.js']);
  }
}

Browse to /admin/reports/status: it still checks the original path.

Proposed resolution

The library.discovery service could be used to get the path of the library.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France prudloff Lille

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024