[#11523] Add universal link() method to Horde_Feed
Summary Add universal link() method to Horde_Feed
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Accepted
Priority 1. Low
Requester sebastian.radish@gmx.de
Created 2012-10-15 (3294 days ago)
Updated 2013-01-07 (3210 days ago)
Assigned 2012-10-25 (3284 days ago)
Patch No

sebastian.radish@gmx.de 2012-10-15 18:36:51
I'm not sure if this is still a problem in Horde 4. Unfortunatly I 
have only a Horde 3 installation to test:

If you a _atom_ feed block to your dashboard, the links are all empty 
The problem is, that atom links are stored like
<link href="http://some/where"/>
whereas in RSS feeds they are stored like

Can anybody confirm this problem on Horde 4? I already had a look at 
the Horde 4 sources and it doesn't seem to be fixed.

Jan Schneider <jan@horde.org> 2012-10-25 16:30:47
Can you provide an example feed?

"Ralf Lang (B1 Systems GmbH)" <lang@b1-systems.de> 2012-10-25 16:42:59
> Can you provide an example feed?

I can provide access to a demo installation which includes this atom 
feed in a horde portal block. Clicking the link leads nowhere.

sebastian.radish@gmx.de 2012-10-26 07:36:40
So it's still a problem in Horde 4?

Jan Schneider <jan@horde.org> 2012-11-26 11:26:46
Yes, and we need to deal with this in Horde_Feed that has to provide a 
versatile link() method for feed entries that transparently handles 
protocol differences. There already is some link() implementation in 
Horde_Feed_Atom, but it doesn't work because it's implemented as if it 
was running on a entry, while the class handles a feed instead.

mazet@softndesign.org 2013-01-07 06:34:13

please find a short/uggly workaround. It avoid that link refers to 
horde site but instead force all link to  atom/rss site.

--- horde4/lib/Block/Feed.php.old       2013-01-07 07:28:11.000000000 +0100
+++ horde4/lib/Block/Feed.php   2013-01-07 07:29:03.000000000 +0100
@@ -69,7 +69,7 @@
                  if (++$count > $this->_params['limit']) {
-               $html .= '<a href="' . $entry->link . '"';
+               $html .= '<a href="' . (strlen($entry->link) ? 
$entry->link : $this->_params['uri']) . '"';
                  if (empty($this->_params['details'])) {
                      $html .= ' title="' . 
htmlspecialchars(strip_tags($entry->description())) . '"';