Statistics Popular Block fails when content is deleted

Created on 12 December 2017, about 7 years ago
Updated 30 April 2024, 10 months ago

If content is deleted, these is a discrepancy between the nodes with statistics and the nodes in the system. The nodeTitleList method does not handle missing nodes which results in an error when calling getTranslationFromContext in a foreach loop.

This patch updates the nodeTitleList method so that only nodes which are still in the system are checked. This eliminates the error.

How to reproduce:
1) Enable the statistics module and the Popular content block, ensure that statistics are registering and the Popular content block contains content.
2) Delete all content
3) Reload a page which contains the popular content block

🐛 Bug report
Status

Needs work

Version

1.0

Component
Statistics 

Last updated 18 days ago

No maintainer
Created by

🇬🇧United Kingdom mattgill

Live updates comments and jobs are added and updated live.
  • 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