Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
aggregator.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2008 at 22:15 UTC
Updated:
11 Jun 2010 at 16:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
dries commentedThanks M. I've committed this patch to CVS HEAD (Drupal 7). It failed to apply against DRUPAL-6 though so I'm changing the version number.
Comment #2
mustafau commentedThis patch applies to DRUPAL-6.
Comment #3
domesticat commentedI'm hesitant to mark this patch RTBC because I'm a patchtest noob, but this one seems to be a no-brainer. I've tested it against D6. It eliminated the double reporting of feed errors in my logs and I've seen no further issues.
Comment #4
stevenpatzComment #5
gábor hojtsyHm. Before the patch, the code structure is as follows:
So this ensures that if there is a new URL, or there was some response, but the data was not parseable, there is an error reported. Also, it reports an error, if the status code is other then 304, 301, 200, 302 and 307. For example, if the code is a 404.
From the patch, I see, it moved the break around, so what it does is:
Looks, I've emphasized your change. So this breaks the cycle of possibly parsing data when the feed was a 301 redirect, which was the intention of the original code. Also, as far as I see, it breaks reporting errors when there was a 200, 302 or 307 but the feed was not parseable.
I assume I might understand something wrong, since you clearly state that the patch makes one of two error messages appear. You don't hovewer present examples of those two error messages, and the one which still appears. So what I can see from here, is that you stepped over error reporting in many cases with this patch. But where is that actual error reporting done now I don't see; drupal_http_request() does not do error reporting itself and this aggregator_refresh() function is called from aggregator_cron() which does not care about any return values or errors produced inside aggregator_refresh().
Comment #6
mustafau commentedaggregator_parse_feed() reports the error.
The structure is like following:
Before:
After:
301 redirects are not affected from the change. Parse errors are reported by aggregator_parse_feed(). Other errors are reported by the "default" case of the switch statement.
Comment #7
mustafau commentedComment #9
mustafau commentedComment #10
gábor hojtsyRight, I've reviewed the patch again, and it looked like doing what it is advertised to do :) Committed.