Problem/Motivation
If you have an aggregator feed on your site, and a block that displays its items, a bad link in the feed can cause page with said block to crash.
Steps to reproduce:
- Install Drupal
- Enable aggregator
- Create a feed with an invalid item (conveniently you can use this as a feed:
https://www.drupal.org/files/issues/2020-04-21/feed.txt β
- Enable an aggregator block on a page, and select said feed.
- Make sure the feed has been fetched
- Visit a page with the block enabled
Proposed resolution
Make sure to not crash on invalid links, and instead skip the item in question.
Remaining tasks
Review patch.
User interface changes
none
API changes
none
Data model changes
none
Release notes snippet
n/a
Original report by alreaud
I've had instances where a bad link in an aggregator feed causes the website to give a white screen of death. You're prevented from logging in as administrator. You may place the site in maintenance mode via Drush, and get the maintenance page to show as the home page. However, as long as the bad link is in the database table, the site remains inoperative with respect to logging in or operating out of maintenance mode.
This bug appears to only happen and cause a site failure if it occurs during a cron run that updates the aggregator feed. I've not been able to reproduce the error by modifying a link entry in table aggregator_item. I've been able to overcome the bug by using phpMyAdmin, going into the database and removing the offending table entry from table aggregator_item.
The error log shows:
[24-Feb-2017 09:07:31 America/Denver] Uncaught PHP Exception InvalidArgumentException: "The URI '/video/us/politics/100000004951486/president-trump-cpac.html?partner=rss&emc=rss' is invalid. You must use a valid URI scheme." at /home/cacnadmin/public_html/core/lib/Drupal/Core/Url.php line 280
...
[24-Feb-2017 09:54:14 America/Denver] Uncaught PHP Exception InvalidArgumentException: "The URI '/video/us/politics/100000004951486/president-trump-cpac.html?partner=rss&emc=rss' is invalid. You must use a valid URI scheme." at /home/xxxxxx/public_html/core/lib/Drupal/Core/Url.php line 280
aggregator_cron() executed at 09:07. The entry is missing the http://news-site-name or https://news-site-name. This should not crash the site, but rather the bad aggregator_item table entry should be ignored, or it should be flagged on the aggregator feed block.