[#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
Owners
Requester sebastian.radish@gmx.de
Created 2012-10-15 (3294 days ago)
Due
Updated 2013-01-07 (3210 days ago)
Assigned 2012-10-25 (3284 days ago)
Resolved
Milestone
Patch No

Comments
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 
(href="").
The problem is, that atom links are stored like
<link href="http://some/where"/>
whereas in RSS feeds they are stored like
<link>http://some/where</link>

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?
http://core.dol2day.com/dolcore/feed/category/a

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
Hi

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']) {
                      break;
                  }
-               $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())) . '"';
                  }