links to original feeds in views

boriso - June 19, 2008 - 14:54
Project:SimpleFeed
Version:5.x-2.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I think I found a bug, or at least a little problem. When using views to display simple feed nodes, and choosing the field : "SimpleFeed Feed Item: Article title", with links, some feeds do not return a working link, because & or & is not converted into &

I made the following simple modification to simplefeed_item_views.inc using str_replace() but I though of letting you know, as there might be a more elegant solution.

/**
* Format a field as a title to the article (possibly as a link)
*/
function views_handler_field_simplefeed_item_title($fieldinfo, $fielddata, $value, $data) {
if ($fielddata['options']) {
// MODIFIED : ADDED THE FOLLOWING TWO LINES
$value = str_replace("&", "&", $value);
$value = str_replace("&", "&", $value);
return l($data->title, $value);
}
else {
return check_plain($data->title);
}
}

#1

boriso - June 19, 2008 - 14:58

oh, well, even drupal parsed correctly the &'s !! So my message would not make sense :

basically & or & is not converted into &

so I added the following piece of code :

$value = str_replace("&", "&", $value);
$value = str_replace("&", "&", $value);

#2

mfer - June 25, 2008 - 18:56

Interesting. How are & or & getting into the database in the first place? Right now, simplefeed grabs either the item or the feed permalink for the url from the simplepie objects.

#3

DanielTheViking - July 8, 2008 - 07:50

Subscribing.

#4

Scott Reynolds - September 30, 2008 - 00:22

ya just missing a decode_entities. See patch

AttachmentSize
item_views.patch 725 bytes

#5

m3avrck - September 30, 2008 - 00:37
Status:active» fixed

Fixed thanks.

#6

Anonymous (not verified) - October 14, 2008 - 00:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.