Bug #90769

Failure of AbstractRssWidget.php breaks dashboard

Added by Christian Hackl 22 days ago. Updated 22 days ago.

Status:
Accepted
Priority:
Should have
Category:
Dashboard
Target version:
Start date:
2020-03-17
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If the RSS feed cannot be obtained, an error (attachment) is thrown regarding the AbstractRssWidget.php so that the dashboard is not displayed at all.

This means that no widget will be displayed that is not affected by the error.

Example quick workaround line 87:
First, this exception would have to be caught differently, and the code that comes after this "if" would have to be put into an else:

if ($rssContent === false) {
    // TODO: Log this error
    // throw new RuntimeException('RSS URL could not be fetched', 1573385431);
} else {
    $rssFeed = simplexml_load_string($rssContent);
    $itemCount = 0;
    foreach ($rssFeed->channel->item as $item) {
        if ($itemCount < $this->limit) {
            $this->items[] = [
                'title' => (string)$item->title,
                'link' => trim((string)$item->link),
                pubDate => (string)$item->pubDate,
                'description' => (string)$item->description,
            ];
        } else {
            continue;
        }
        $itemCount++;
    }
    $this->cache->set($cacheHash, $this->items, ['dashboard_rss'], $this->lifeTime);
}

To display all widgets that are not affected by the error.

AbstractRssWidget.jpg View (305 KB) Christian Hackl, 2020-03-17 12:45

History

#1 Updated by Christian Hackl 22 days ago

Forgot attachment

#2 Updated by Georg Ringer 22 days ago

  • Status changed from New to Accepted
  • Assignee set to Richard Haeser
  • Target version set to 10 LTS

Also available in: Atom PDF