[jonah] Broken(?) freshmeat rdf src and workaround

Daniel Eckl daniel.eckl at gmx.de
Sun Dec 12 12:30:02 PST 2004


Hi!

I like to use this rdf src:
http://download.freshmeat.net/backend/fm-releases-unix.rdf
using jonah-HEAD-2004-12-11 on horde3 rc3.

This seems to have a bug in either the source or in jonah's rdf parser.

Effects:

1: If you are the user who triggers the new rdf fetch with your page load, then
there is a php error message shown: "Undefined index:  link in
/srv/www/htdocs/horde/jonah/lib/News.php on line 371" which referres to the
index "link" of the array $story. I think because of the bug, this is not set.

2. the story title is set to the fallback "No title". So there is an empty story
line on the content page.

Solutions:

There could be a workaround for the first error with this patch (or similar):

--- jonah/lib/News.php.orig     2004-12-12 15:11:03.000000000 +0100
+++ jonah/lib/News.php  2004-12-12 21:25:04.179918240 +0100
@@ -368,7 +368,7 @@
                 $items[$key]['story_id'] = $key;
                 $items[$key]['story_title'] = isset($story['title']) ?
$story['title'] : _("[No title]");
                 $items[$key]['story_desc'] = isset($story['description']) ?
$story['description'] : '';
-                $items[$key]['story_url'] = Horde::externalUrl($story['link']);
+               $items[$key]['story_url'] = isset($story['link']) ?
Horde::externalUrl($story['link']) : "";
                 $items[$key]['story_date'] = $timestamp;
             }
         }

But I think that fixes only the symptom, not the problem. As said, this seems to
be a problem in the rdf source (though I couldn't find some), or a problem of
the rdf parser.

I cannot go so deep into the rdf parser to fix this by myself... Not enough
knowledge. :-/

Thanks,
Daniel


More information about the jonah mailing list