Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a feed is not parseable Aggregator gives a parse error and then another "feed not parseable" error. "feed not parseable" error is unnecessary. Attached patch eliminates "feed not parseable" error.
Comment | File | Size | Author |
---|---|---|---|
#2 | not_parseable_messages_d6.patch | 1.12 KB | mustafau |
not_parseable_messages.patch | 1.11 KB | mustafau | |
Comments
Comment #1
Dries CreditAttribution: 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 CreditAttribution: mustafau commentedThis patch applies to DRUPAL-6.
Comment #3
domesticat CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: mustafau commentedComment #9
mustafau CreditAttribution: mustafau commentedComment #10
Gábor HojtsyRight, I've reviewed the patch again, and it looked like doing what it is advertised to do :) Committed.