Broken links + Notice : Undefined offset: 1 in theme_print_url_list(). Revert commit #2897361

Created on 22 June 2022, over 2 years ago
Updated 21 June 2024, 5 months ago

I'm getting plenty of these notices in my log since I updated to 7.x-2.4:
Notice : Undefined offset: 1 in theme_print_url_list() (ligne 357 in [...]/sites/all/modules/print/print.pages.inc).

Commit at #2897361: Source URL and Links needs to be rendered as Hyperlinks seems to be responsible for that. This code is doing 2 things making URL links vs text and shorting URL's by removing the base URL.

The errors shows in logs when a link in content does not contain the base URL like: external links, http vs https, mailto, or tel.

It outputs broken links such as:
https://example.com/node/target='_blank'

I suggest keeping the spirit of the original patch, but include a check for URL that do not contain the base URL after the $new_url explode.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France anrikun

Live updates comments and jobs are added and updated live.
  • Regression

    It restores functionality that was present in earlier versions.

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.

Production build 0.71.5 2024