Insights reports throws error on sites without paragraphs

Created on 28 February 2025, about 2 months ago

Problem/Motivation

When the reports are generated for Xray audit in a site without paragraphs module installed, there appears this error:

In Url.php line 216:
                                                                  
  The user-entered string '' must begin with a '/', '?', or '#'.

This happens because by default, the "Paragraphs with Excessive Revisions" insight is active. The problem can be solved by excluding it in configuration, but however it would be nice that the default configuration does not produce an error.

Steps to reproduce

- Use Xray Audit 1.5.13 with xray_audit and xray_audit_insights modules installed
- Run: drush status-report --fields=title,severity,sid,description --severity=1

Proposed resolution

The problem happens when the URL for the reports link is generated at this line: https://git.drupalcode.org/project/xray_audit/-/blob/1.x/modules/xray_au...

The report link is only used when there are excessive paragraphs, so we can move these lines to the conditional, and then, the error would not happen as there are no excessive paragraphs to meet the condition.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain omarlopesino

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