Zend Framework

Zend_Feed_Rss _element is not channel when rdf:RDF element exists

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.7.5
  • Fix Version/s: None
  • Component/s: Zend_Feed
  • Labels:
    None

Description

code to reproduce:

$f = Zend_Feed::import('http://www.laut.de/partner/allgemein/news.rdf');
var_dump($f->title());

echo $f->getDom()->tagName;

actual output:
null
rdf:RDF

expected output:
channel
laut.de - news

This patch solves the problem, all unit tests still pass.

--- library/Zend/Feed/Rss.php   (revision 14152)
+++ library/Zend/Feed/Rss.php   (working copy)
@@ -80,11 +80,8 @@
         parent::__wakeup();

         // Find the base channel element and create an alias to it.
-        if ($this->_element->firstChild->nodeName == 'rdf:RDF') {
-            $this->_element = $this->_element->firstChild;
-        } else {
-            $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
-        }
+        $this->_element = $this->_element->getElementsByTagName('channel')->item(0);
+
         if (!$this->_element) {
             /**
              * @see Zend_Feed_Exception

Someone who knows where this is needed should fix the problem.

Activity

Hide
Niko Sams added a comment -

Ok, my patch is obviously wrong - as feed elements don't work anymore with it

so the only issue is that $feed->title() isn't working properly.

Show
Niko Sams added a comment - Ok, my patch is obviously wrong - as feed elements don't work anymore with it so the only issue is that $feed->title() isn't working properly.
Hide
Pádraic Brady added a comment -

Please note that any missing or non-standard behaviour will not be fixed. Users are advised that Zend_Feed is basically deprecated (not in ZF2) and they should use/migrate to Zend_Feed_Reader/Zend_Feed_Writer which are far more comprehensive, adherent to all standards, easier to use, simple to extend for RSS/Atom extensions and which have somewhere in excess of 1000 unit tests to back those statements up (or was it almost 1500?). Anyway - I almost broke my fingers in testing . Using the newer components will also make transitioning new functionality to ZF2 that much easier.

Show
Pádraic Brady added a comment - Please note that any missing or non-standard behaviour will not be fixed. Users are advised that Zend_Feed is basically deprecated (not in ZF2) and they should use/migrate to Zend_Feed_Reader/Zend_Feed_Writer which are far more comprehensive, adherent to all standards, easier to use, simple to extend for RSS/Atom extensions and which have somewhere in excess of 1000 unit tests to back those statements up (or was it almost 1500?). Anyway - I almost broke my fingers in testing . Using the newer components will also make transitioning new functionality to ZF2 that much easier.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: