The watchdog message in aggregator.fetch.inc refers to $feed->title, a value that is not guaranteed to be known

Created on 10 November 2011, about 13 years ago
Updated 29 August 2023, over 1 year ago

The current watchdog message in aggregator.fetch.inc, aggregator_aggregator_fetch(), informs the user of an error by referring to the feed's title.

watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING);

I've found that $feed->title can be null, leading to a PHP error. In addition, $feed->title is not as useful as $feed->url. Given $feed->title, a user needs to dig into configuration to find the feed's url in order to investigate why the feed is returning an error.

I propose the following change:

watchdog('aggregator', 'The feed from %url seems to be broken, due to "%error".', array('%url' => $feed->url, '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING);

$feed->url is likely to exist and given the URL in the error message, a developer can more rapidly track down the issue causing the feed access to fail.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

aggregator.module

Created by

πŸ‡ΊπŸ‡ΈUnited States jessebeach

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

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