Problem/Motivation

When using the database log for debugging, sometimes it would be useful to be able to quickly jump to the next or previous record.

Steps to reproduce

Proposed resolution

Add Next/Previous links/buttons somewhere on the /admin/reports/dblog/event/12345 page.

Remaining tasks

Decide on UI
Write patch

User interface changes

New links/buttons on the database log entry pages.

API changes

None

Data model changes

None

Release notes snippet

Issue fork drupal-3163716

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

longwave created an issue. See original summary.

idebr’s picture

According to #2015149: Replace dblog recent log entries with a view comment #142 this is by design:

According to #1909474: Use light (lite) pager by default: Use light (lite) pager by default all core listings are now using minipagers. So agree with jibran. Lets keep the mini pager for logs too. Users can configure it to use the full pager if they need it.

dagmar’s picture

I think @longwave refers when you are viewing a particular event page page, not the listing page. I think this is a valid feature request.

longwave’s picture

Yeah, I often find when I'm using dblog to figure out an issue that I start from the listing page and then end up opening numerous tabs and lose track of which order the events happened in. I realised that basically I just want to jump in sequence from one log entry to the next usually, so a Next button would be really helpful.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vinaygawade’s picture

Assigned: Unassigned » vinaygawade

Working on this Feature request.

vinaygawade’s picture

Status: Active » Needs review

Hi,
I've submitted a merge request for review that implements navigation between database log event pages using "Next" and "Previous" buttons.

Please review and share any feedback. Thanks!

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs usability review, +Needs screenshots

Will need UX sign off, but the issue summary seems to be void of screenshots to assist the UX team. Tagging for such

Thanks!

vinaygawade’s picture

Status: Needs work » Needs review
StatusFileSize
new297.59 KB
new307.36 KB
new258.17 KB
new569.16 KB

Thanks for the update!

I've added some screenshots showing the new navigation links added to the DB log detail page:

- Example of the “Next” and “Previous” links at the bottom of a log entry.

- Behavior at the first and last entry to show correct disabling/hiding of links.

Let me know if further clarification is needed.

dagmar’s picture

Status: Needs review » Needs work
Issue tags: -Needs screenshots

@vinaygawade Thanks. Looks really good. I think the symbols next to Next > and < Prev will have to live outside the text buttons, so we can reuse translations.

I also checked if would be possible to have only one query instead of 2. But it requires the use of UNION, and there is no real gain there.

Finally would be good to have a test when there is only one entry in the logs. To verify no buttons and no errors are rendered.

vinaygawade’s picture

Thank you @dagmar,

- Good point about the arrow symbols — I’ve removed them for simplicity, so the translatable strings can be reused.
- I agree on the single-query idea — not worth the added complexity for minimal gain.
- I also tested the case with only one log entry. On the event details page, no Previous or Next buttons are rendered, and everything works without errors.

Let me know if you have any other feedback!

vinaygawade’s picture

Added prev/next ID handling in overview() to avoid extra DB queries in eventDetails(). Uses query params for faster navigation between log entries.

vinaygawade’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.59 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

vinaygawade’s picture

Status: Needs work » Needs review
vinaygawade’s picture

StatusFileSize
new297.45 KB
new258.43 KB
new268.04 KB
new527.5 KB

Added updated screenshots for review.

dagmar’s picture

Status: Needs review » Needs work
    Db Log (Drupal\Tests\dblog\Functional\DbLog)
     ✘ Db log
       ┐
       ├ Behat\Mink\Exception\ResponseTextException: The text "Deleted user: m2oadm70 ." was not found anywhere in the text of the current page.
       │
       │ /builds/issue/drupal-3163716/vendor/behat/mink/src/WebAssert.php:907
       │ /builds/issue/drupal-3163716/vendor/behat/mink/src/WebAssert.php:293
       │ /builds/issue/drupal-3163716/core/tests/Drupal/Tests/WebAssert.php:981
       │ /builds/issue/drupal-3163716/core/modules/dblog/tests/src/Functional/DbLogTest.php:534
       │ /builds/issue/drupal-3163716/core/modules/dblog/tests/src/Functional/DbLogTest.php:422
       │ /builds/issue/drupal-3163716/core/modules/dblog/tests/src/Functional/DbLogTest.php:89

It seems one test is not passing now.

rkoller’s picture

Issue tags: -Needs usability review
StatusFileSize
new1.48 MB

Usability review

We discussed this issue at #3523597: Drupal Usability Meeting 2025-05-16. That issue will have a link to a recording of the meeting.

For the record, the attendees at the usability meeting were benjifisher, rkoller, shaal, simohell, and worldlinemine.

We have based todays discussion on MR12089, in the following a list of details we’ve noticed:

  • Previous and Next are styled as buttons, but they are actually links.
  • In the current state each button only contains a button label, the user is required to read/skim the label, there are no visual cues like additional iconography.
  • Since the two buttons link to other pages, strictly speaking SC2.4.4 (Link purpose - in context) applies here - after the labels Previous and Next are missing some sort of context.
  • When you are on a details page and press the Previous or Next button repeatedly, you will notice that the column with the row labels is sort of uneasy and shifting constantly in width in between log messages - on some page the column gets even that narrow that the label wraps to a second line. From a readability point of view, you don’t have a fixed starting point for your eyes, you have to adjust on every page, which leads to an increased cognitive load if you are clicking through several error messages in a row (see column_width.mp4).
  • If you consider the use case of a site with thousands of recent log messages, there is the problem that the Previous and Next button are not respecting the applied filters. If you filter your log messages for example for a particular error message, and then click on one of the filter results, the filter scope is being reset - pressing Previous or Next on the details page will not bring you to the next/previous log message of your filter results, but to the next log message overall.

Aside the aforementioned points we’ve also asked ourselves if there is already a pattern in Core using such a Previous and Next pattern to step through instances - but we were unable to come up with one - there is only the remotely related Pager pattern used on Views (for example on /admin/content). In conclusion, these are the points the group reached a consensus on to suggest in scope for this issue:

  1. Instead of displaying links as buttons, style them as actions links (see Drupal Design System) - that would be semantically more appropriate since each of the two point to a new page. Also re-add those single forward and backward step icons shown on the Figma link.
  2. Add some context to the button label by using the slightly more verbose Previous log message & Next log message as the label for the action links.
  3. Let the Previous and Next action links respect a set filter value. If you are for example filtering for the type “php” with a severity of “error” and you get four matches, log message number 25, 126, 134, 175, and you click on the detail view for number 126, the behavior on the detail page should be as follows:
    • There should be a button with the label Clear filter
    • Clicking Next, forwards you to log message number 134
    • Clicking Previous twice, forwards you to log message number 25
    • Clicking the Clear filter button, the button would get hidden, and in this case the previous button would get shown again (since in the scope of the filter results 25 is the first available message and Previous button hidden) - clicking the Previous button would forward you to log message number 24, clicking the Next button to log message 26, instead of going through the four available numbers of filter results.
    • Through the display of the Clear filter button it should be self explanatory that the current scope of displayed log messages are filter matches, while when the Clear filter button is not shown the scope is all the existing log messages. But ideally that could be validated in user tests, perhaps additional (visual) cues might be necessary.

In regard to the problem with the shifting column width, we’ve thought that is not “directly” related to this issue and should probably be moved to a followup issue instead.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

dagmar’s picture

In regard to the problem with the shifting column width, we’ve thought that is not “directly” related to this issue and should probably be moved to a followup issue instead.

Created the follow up for https://www.drupal.org/project/drupal/issues/3525492

In regard to the problem with the shifting column width, we’ve thought that is not “directly” related to this issue and should probably be moved to a followup issue instead.

Good point. This will be interesting to implement. Not sure if this will also require extract the logic of filtering from the dblog controller so we can reuse the logic in both the dblog details and the listing.

Also, I'm thinking this will create some caching issues to consider as well.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.