Atom errors on some feeds
-
I’ve had this error for a while where trying to look up Atom feeds from some providers puts up a wall of warning messages relating the magpiefromsimplepie.class.php
The issue came down to authorship missing on their feed. I was able to get around it when I changed this up. I’m not sure if it’s the absolute right way to go about it but it stopped the issue from happening again.
All I ended up changing was this the foreach statement under normalize_author_inheritance in magpiefromsimplepie.class.php
if (!isset($item["author#"])) : $authors = $original->get_authors(); foreach ($authors as $author) : $tag = $this->increment_element($item, 'author', 'atom', array()); $item[$tag] = $item["{$tag}_name"] = $author->get_name(); if ($author->get_link()) : $item["{$tag}_uri"] = $item["{$tag}_url"] = $author->get_link(); endif; if ($author->get_email()) : $item["{$tag}_email"] = $author->get_email(); endif; endforeach; endif; }
Over to this
if (!isset($item["author#"])) : $authors = $original->get_authors(); foreach ((array)$authors as $author) : $tag = $this->increment_element($item, 'author', 'atom', array()); $item[$tag] = $item["{$tag}_name"] = $author->get_name(); if ($author->get_link()) : $item["{$tag}_uri"] = $item["{$tag}_url"] = $author->get_link(); endif; if ($author->get_email()) : $item["{$tag}_email"] = $author->get_email(); endif; endforeach; endif; }
Hopefully this helps out, was worried about submitting it along until I was sure had worked for the feeds that had been putting up the errors.
- The topic ‘Atom errors on some feeds’ is closed to new replies.