StatisticsPopularBlock breaks a page rendering when nid left orphan

Created on 24 July 2018, over 6 years ago
Updated 30 April 2024, 10 months ago

Problem/Motivation

I found an annoying bug in statistics module - it crashes the site page rendering if you somehow have nid for non-existing node in the node_counter table. I don't know how it happened and I could not make it happen at will, but reference to a deleted node has not been removed from the table. That causes use of NULL instead if the node object and the site page rendering breaks - on every page that has StatisticsPopularBlock. The fix is simple - just 2 lines to modify in the function StatisticsPopularBlock::nodeTitleList(). I can supply a patch for the fix, it is pretty obvious on lines 195 and 196 in StatisticsPopularBlock.php file.

Steps to reproduce

Proposed resolution

TBD

Remaining tasks

Update patch
Add a test
Review
Commit

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

πŸ› Bug report
Status

Needs review

Version

1.0

Component
StatisticsΒ  β†’

Last updated 18 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States calmforce

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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