Warnings from Dom document loading when parsing metatags

Created on 12 June 2024, 7 months ago
Updated 28 July 2024, 6 months ago

Problem/Motivation

shorthand_metatags_alter parses the head of a shorthand document but can trigger warnings in error logs

In my testing loading a single page that references a shorthand story via a shorthand local field resulted in 38 warnings in the logs which can create noise. We don't really care about these warnings that PHP is generating.

Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity, line: 89 in shorthand_metatags_alter() (line 138 of modules/contrib/shorthand/shorthand.module).

Steps to reproduce

Enable verbose logging
Visit a node that has a shorthand local field with metatags enabled

Proposed resolution

Use Html utility class from Drupal for parsing instead as this silences warnings/deals with malformed HTML

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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