Problem/Motivation

In #3502465: Reduce the amount of information relayed on error by the DrupalOrgJsonApi plugin to the front-end, we changed the message that we show to users if there is an error. Part of that message is: See the error log for details.

It'd be great if we could detect if the dblog module is enable and offer a link in that message.

Steps to reproduce

You can do the changes seen in this commit https://git.drupalcode.org/project/project_browser/-/merge_requests/685/... to force the error (just don't commit them).

Proposed resolution

Detect if dblog is enabled, and in that case have the words error log point at it, otherwise leave the message as is.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fjgarlin created an issue. See original summary.

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
Status: Active » Needs review

Made the required changes.
Checked if the dblog module is enabled or not. If enabled, the is a link to the dblog overview page which is embeded in the "error log" string of the error message. If the dblog module is not enabled, the error message is shown as it is.
Please review MR !704.

sayan_k_dutta’s picture

Made the changes requested. Please review.

phenaproxima’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new30.35 KB
new31.7 KB

Gave this a quick manual testing using the error-forcing method described in the issue summary.

Without dblog enabled, I see this when fetching modules:

An error message when fetching modules, that doesn't link to the error log.

And with it:

An error message when fetching modules, including a link to the error log.

That's pretty straightforwardly what I'd expect. The "error log" link takes me to the error log as promised, and the first thing in it is the HTTP error that came back from d.o. Definitely useful for forensic purposes.

I'd say this is pretty clearly good to go.

phenaproxima’s picture

Title: Add link to dblog if enabled » HTTP errors from the DrupalDotOrgJsonApi source should link you to the error log if it's available

chrisfromredfin made their first commit to this issue’s fork.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

nice little ux improvement here!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.