History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-26
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Matthew Turland
Reporter: Zend Framework
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Feed doesn't read entries not in the channel element (TRAC#7)

Created: 19/Jun/06 10:48 PM   Updated: 02/Feb/09 06:03 PM
Component/s: Zend_Feed
Affects Version/s: 0.1.3, 1.7.3
Fix Version/s: 1.8.0

Time Tracking:
Not Specified

Issue Links:
Dependency
 
Related
 

 Public Fields   Internal Project Management Fields   
Tags:
Participants: Benjamin Eberlei, Bill Karwin, Matthew Turland, Satoru Yoshida, Simone Carletti, Wil Sinclair and Zend Framework
Fix Version Priority: Should Have


 Description  « Hide
After running into this problem in my own feed class, I tried the Zend version out to try to figure out the problem. Turns out it's from entry items NOT being in the channel element. See this feed for an example: http://feeds.feedburner.com/37signals/beMH

Here's my quick and dirty solution:

protected function _buildEntryCache()
{
  $this->_entries = array();
  foreach ($this->_element->childNodes as $child) {
    if ($child->localName == $this->_entryElementName) {
      $this->_entries[] = $child;
    }
  }

    // Added this.
  if (count($this->_entries) == 0) {
    foreach ($this->_element->parentNode->childNodes as $child) {
      if ($child->localName == $this->_entryElementName) {
        $this->_entries[] = $child;
      }
    }
  }
}


 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Bill Karwin - 13/Nov/06 03:16 PM
Changing fix version to 0.6.0.

Simone Carletti - 01/Dec/07 12:42 PM
I forgot to say that my previous comment has been inspired by http://www.nabble.com/zend-feed-issue--tf4928553s16154.html#a14108105

Simone Carletti - 01/Dec/07 12:43 PM
Forgive me for previous comment.
It was created for ZF-405, I posted it here by mistake.

Matthew Turland - 31/Jan/08 07:50 PM
The following example appears to work as expected as of SVN revision 7745:

require_once 'Zend/Feed.php';

$feed = Zend_Feed::import('http://feeds.feedburner.com/37signals/beMH');

foreach ($feed as $item) {
echo 'title: ', $item->title(), "\n";
echo 'link: ', $item->link(), "\n\n";
}


Simone Carletti - 01/Feb/08 02:30 AM
The issue still exists.
The reason why you wasn't able to reproduce it is just because the feed you tested is no longer an RSS feed but it's now served as Atom feed and Zend_Feed correctly supports Atom feeds.

Have a look at the following example:

require_once 'Zend/Feed.php';

$feed = Zend_Feed::import('http://maine.craigslist.org/web/index.rss');

foreach ($feed as $item) { echo 'title: ', $item->title(), "\n"; echo 'link: ', $item->link(), "\n\n"; }

Matthew Turland - 03/Feb/08 09:24 AM
Please see the attachment patch.diff for ZF-405. This appears to correct this issue.

For the particular feed cited below, something I noticed that wasn't the case for ZF-405 is that there are two title attributes per item, title and dc:title, and the returned Zend_Feed_Rss object reflects this. I'm not sure if this should be considered a "feature" or a "bug" being that, in most cases, the two elements have the same value anyway.

http://maine.craigslist.org/web/index.rss


Wil Sinclair - 19/Dec/08 03:06 PM
Matthew, what is the status of this issue? Do you need someone to apply your patch?

Matthew Turland - 19/Dec/08 05:51 PM
Wil, I've updated ZF-405 with a new version of the patch. It does not modify the suggested change to Zend_Feed_Rss::__wakeup (which still works), but updates the unit tests in a way that I think will be more agreeable to other developers. But yes, I don't believe I have the access needed to commit the patch myself, so it will need to be committed by someone else.

Benjamin Eberlei - 08/Jan/09 04:39 AM
Applied patch from Matthew in ZF-405, which solves this issues.

Satoru Yoshida - 02/Feb/09 06:03 PM
Sorry, not in 1.7.4. I think it may be released in next minor.