Problem/Motivation

Once upon a time aggregator did its own RSS parsing.
During the D8 cycle we moved to using a third-party parsing library provided by Zend.
The error is no longer occurring but it is not know if we have test coverage (either in core, or in Zend) for invalid descriptions.

Undefined index: DESCRIPTION in aggregator.module on line 631.

Proposed resolution

Review test coverage in core and Zend and ascertain if there is handling for malformed RSS descriptions.
If so, we can mark this closed (duplicate) and link to the issue where we added Zend's feed parser
If not, we can revive the test coverage here.

Remaining tasks

Review test coverage in core and zend to ascertain if mangled descriptions are handled.
If not, revive the test coverage here.

User interface changes

API changes

Data model changes

Release notes snippet

This error appears if a feed's channel has no description element. Attached patch fixes the error.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

obsidiandesign’s picture

Rerolled the patch - got "fuzz 2 (offset 9 lines)" with the original. Tested with an RSS feed w/o description to confirm the error message, patch corrects the issue. All SimpleTests for Aggregator succeed after applying the patch. +1 for RTBC.

(patch re-uploaded so it's the full path)

mustafau’s picture

Priority: Normal » Critical
FileSize
1.28 KB

Re-roll.

Critical because aggregator is not working without this.

cburschka’s picture

I understand adding the array with empty default values.

Why are you moving the $etag line to above the foreach loop? Is this needed?

cburschka’s picture

Status: Needs review » Reviewed & tested by the community

Mh, never mind, it does seem cleaner to put it together with the $modified line.

Testbot thinks this works, and I think the code looks good. RTBC?

Damien Tournoud’s picture

Status: Reviewed & tested by the community » Needs work

This needs a test.

cburschka’s picture

Tricky to come up with a meaningful test case there. description is a required field in RSS, so should the test case check for behavior of missing title/link as well?

Damien Tournoud’s picture

If 'description' is a required field, wouldn't the sensible thing to do be to reject the feed altogether?

cburschka’s picture

Status: Needs work » Needs review
FileSize
2.02 KB

I've added a test function to UpdateFeedTestCase that may catch this, but currently even running the unmodified test case crashes with a 500 on my server, so someone else will need to work on this.

Note: This one *only* adds the test function, you still need to apply the above patch. This is to make sure the unpatched site fails the test.

Status: Needs review » Needs work

The last submitted patch failed testing.

cburschka’s picture

Status: Needs work » Needs review
FileSize
2.02 KB

Works for me; the problem must be on your end, testbot.

Status: Needs review » Needs work

The last submitted patch failed testing.

mustafau’s picture

Status: Needs work » Needs review
FileSize
1.93 KB

Reroll of the test.

The issue is fixed in CVS HEAD. If this test gets committed, I will submit a patch for DRUPAL-6.

brianV’s picture

Status: Needs review » Reviewed & tested by the community

Test looks correct to me, and covers untested code.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Awesome. Three things:

1. Rather than encoding the invalid feed in a function body, could we create a separate .xml file for it under modules/aggregator/tests, and read it in, as our other aggregator feed tests work?

2. + function testUpdateInvalidFeed() { just needs a quick one-line PHPdoc.

3. // Set correct title so deleteFeed() will work. I don't understand this comment. Could you put it above the line it's referencing rather than beside, and expand it out a little to explain?

cburschka’s picture

3. // Set correct title so deleteFeed() will work. I don't understand this comment. Could you put it above the line it's referencing rather than beside, and expand it out a little to explain?

I don't get that part either. Indeed, the $feed->title and $edit['title'] have to be equal in order for the assert in deleteFeed() to pass. But I don't see why they would not be equal already. I can't run the test right now to find out, alas.

cburschka’s picture

Update: Apparently I can run tests after all (Ubuntu has a lovely php5-curl package). So to test my theory, I simply replaced the assignment with an assertEqual to see what happened.

Here's what:

FAIL: $feed->title = "d7clean_s965079QOHBI2rXDQ", $edit['title'] = "d7clean_s965079CR5ILeCzhR";

Next: Why does this happen? This would be what the inline comment should answer...

Edit: OH. Sorry. createFeed() generates one name. Then getFeedEditArray() generates a new name. The feed is then updated to the new title. The $feed object is left as it is. When deleting the $feed, obviously deleteFeed() will look for $feed->title in the delete message, although the feed has since then been renamed to $edit['title'] in the database.

Now I understand. :)

sun.core’s picture

Can we quickly re-roll this sucker to get this done?

mr.baileys’s picture

Priority: Critical » Normal

Since the bug itself has been fixed in HEAD, this is now a "needs tests" issue, and no longer critical.

Jody Lynn’s picture

Version: 7.x-dev » 8.x-dev
webchick’s picture

Title: Undefined index: DESCRIPTION in aggregator.module on line 631. » Tests for aggregator items with no description
webchick’s picture

Issue tags: +Needs tests

.

webchick’s picture

Title: Tests for aggregator items with no description » Tests for aggregator feeds with no description

Sheesh. One of these days I'll get it right. :)

jhedstrom’s picture

Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

Is this still relevant with the move to Zend libraries for feed processing?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

larowlan’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs work

I reviewed this as part of the Bug Smash Initiative.

I think what we need to do here is confirm if there are tests for this type of error in Zend feed parsing and if so, we can close this.

I've updated the issue summary.

larowlan’s picture

Issue tags: +Novice
quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review

Here are tests for missing description.

Is that sufficient?

quietone’s picture

catch’s picture

Category: Bug report » Task
Status: Needs review » Fixed

#34 seems fine. I think we can close this one.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.