PHP notices thrown by h5p_preprocess_menu_local_task()

Created on 29 July 2021, almost 3 years ago
Updated 29 January 2023, over 1 year ago

Problem/Motivation

If a local tasks link doesn't have a ['path'] in its array, then all three if statements in the h5p_preprocess_menu_local_task() throw php notices.

ex:
Notice: Undefined index: path in h5p_preprocess_menu_local_task() (line 1901 of /mysite/web/public/sites/all/modules/contrib/h5p/h5p.module).

Steps to reproduce

As an admin (or someone who can see the local tasks menu), find a page with a custom or contrib link in the local tasks menu that doesn't have a path set in the array. For example, the feeds module can add an "import" link to the admin/content pages that doesn't have a path set.

Proposed resolution

Check if that array value exists before running these if statements.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇺🇸United States sim_1

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.

  • 🇫🇮Finland Anaconda777

    Hi,

    Applied the patch to 1.51 D7 H5P version but the error messages are still appearing in the Drupal logs.

    When opening the admin/content page as admin, these errors are coming to logs:

    Warning: Undefined array key "path" in function h5p_preprocess_menu_local_task() (line 1907 in file /var/www/html/drupal72/web/sites/site/modules/h5p/h5p.module).

Production build 0.69.0 2024