- Posts: 1
COMMUNITY FORUM
BUG - Please fix it
- webbolo
- Topic Author
- Offline
- New Member
Less
More
12 years 1 week ago #51467
by webbolo
BUG - Please fix it was created by webbolo
Hello,
I found a bug in Simple RSS Feed Reader Module.
It shows only one item (the last one) from this horoscope feed:
magazine.quotidiano.net/oroscopo/feed
The problem is at line 74 in helper.php :
$feedItemsArray[$itemDateIndex] = $feedElements[$key];
Since all my feed elements have the same date, they overwrite themselves in php array and only the last one is displayed. I suggest using a different array key. Example:
$i=0;
foreach($sourceFeed->get_items() as $key=>$item){
// Let's give ourselves a reference to the parent $sourceFeed object for this particular item.
$sourceFeed = $item->get_feed();
// Create an object to store feed elements
$feedElements[$key] = new JObject;
$feedElements[$key]->itemTitle = $item->get_title();
$feedElements[$key]->itemLink = $item->get_permalink();
$feedElements[$key]->itemDate = $item->get_date($dateFormat);
$feedElements[$key]->feedTitle = $sourceFeed->get_title();
$feedElements[$key]->itemDescription = $item->get_content();
$feedElements[$key]->feedURL = $item->get_feed()->subscribe_url();
$feedElements[$key]->feedImageSrc = '';
if($feedFavicon) $feedElements[$key]->feedFaviconFile = $item->get_feed()->get_favicon();
$feedElements[$key]->siteURL = $item->get_feed()->get_link();
// Give each feed an index based on date
$itemDateIndex = $item->get_date('YmdHi');
// Pass all feed objects to an array
$feedItemsArrayb]$i[/b = $feedElements[$key];
$i++;
}
Thanks,
Vincenzo
I found a bug in Simple RSS Feed Reader Module.
It shows only one item (the last one) from this horoscope feed:
magazine.quotidiano.net/oroscopo/feed
The problem is at line 74 in helper.php :
$feedItemsArray[$itemDateIndex] = $feedElements[$key];
Since all my feed elements have the same date, they overwrite themselves in php array and only the last one is displayed. I suggest using a different array key. Example:
$i=0;
foreach($sourceFeed->get_items() as $key=>$item){
// Let's give ourselves a reference to the parent $sourceFeed object for this particular item.
$sourceFeed = $item->get_feed();
// Create an object to store feed elements
$feedElements[$key] = new JObject;
$feedElements[$key]->itemTitle = $item->get_title();
$feedElements[$key]->itemLink = $item->get_permalink();
$feedElements[$key]->itemDate = $item->get_date($dateFormat);
$feedElements[$key]->feedTitle = $sourceFeed->get_title();
$feedElements[$key]->itemDescription = $item->get_content();
$feedElements[$key]->feedURL = $item->get_feed()->subscribe_url();
$feedElements[$key]->feedImageSrc = '';
if($feedFavicon) $feedElements[$key]->feedFaviconFile = $item->get_feed()->get_favicon();
$feedElements[$key]->siteURL = $item->get_feed()->get_link();
// Give each feed an index based on date
$itemDateIndex = $item->get_date('YmdHi');
// Pass all feed objects to an array
$feedItemsArrayb]$i[/b = $feedElements[$key];
$i++;
}
Thanks,
Vincenzo
Please Log in or Create an account to join the conversation.
- innocence
- Offline
- New Member
Less
More
- Posts: 16
11 years 11 months ago - 11 years 11 months ago #51468
by innocence
Replied by innocence on topic Re: BUG - Please fix it
Wait, wait, wait, Vincenzo!
I´d be great if you could tell me and other newbies where to implement those changes. Some lines I recognize or find but others don´t even exist.
I´ll be very grateful.
Thanks in advance and greetings from Argentina,
Paul.-
EDIT: I finally managed to do it. Replaced from line 53 to 75 (included) with your code. Seems to work fine but I have another problem I cannot solve :( : Feed image array shows always the same image.
Well... however. Thanks anyway!
I´d be great if you could tell me and other newbies where to implement those changes. Some lines I recognize or find but others don´t even exist.
I´ll be very grateful.
Thanks in advance and greetings from Argentina,
Paul.-
EDIT: I finally managed to do it. Replaced from line 53 to 75 (included) with your code. Seems to work fine but I have another problem I cannot solve :( : Feed image array shows always the same image.
Well... however. Thanks anyway!
Please Log in or Create an account to join the conversation.
- lytroo
- Offline
- New Member
Less
More
- Posts: 1
11 years 9 months ago #51469
by lytroo
Replied by lytroo on topic Re: BUG - Please fix it
In the new release the code looks a little differant. For the Joomla 2.5-3.0 you replace lines 41-63 with the following code:
$i = 0;
foreach($parsedFeeds as $feed){
foreach($feed->feedItems as $key=>$item){
// Create an object to store feed elements
$feedElements[$key] = new JObject;
$feedElements[$key]->itemTitle = $item->title;
$feedElements[$key]->itemLink = $item->link;
$feedElements[$key]->itemDate = strftime($dateFormat,strtotime($item->pubDate));
$feedElements[$key]->itemDateRSS = $item->pubDate;
$feedElements[$key]->itemDescription = $item->description;
$feedElements[$key]->feedImageSrc = '';
$feedElements[$key]->feedTitle = self::wordLimiter($feed->feedTitle,10);
$feedElements[$key]->feedURL = $feed->feedSubscribeUrl;
$feedElements[$key]->siteURL = $feed->feedLink;
// Give each feed an index based on date
$itemDateIndex = strftime('%Y%m%d%H%M',strtotime($item->pubDate));
// Pass all feed objects to an array
$feedItemsArrayb]$i[/b = $feedElements[$key];
$i++;
}
}
$i = 0;
foreach($parsedFeeds as $feed){
foreach($feed->feedItems as $key=>$item){
// Create an object to store feed elements
$feedElements[$key] = new JObject;
$feedElements[$key]->itemTitle = $item->title;
$feedElements[$key]->itemLink = $item->link;
$feedElements[$key]->itemDate = strftime($dateFormat,strtotime($item->pubDate));
$feedElements[$key]->itemDateRSS = $item->pubDate;
$feedElements[$key]->itemDescription = $item->description;
$feedElements[$key]->feedImageSrc = '';
$feedElements[$key]->feedTitle = self::wordLimiter($feed->feedTitle,10);
$feedElements[$key]->feedURL = $feed->feedSubscribeUrl;
$feedElements[$key]->siteURL = $feed->feedLink;
// Give each feed an index based on date
$itemDateIndex = strftime('%Y%m%d%H%M',strtotime($item->pubDate));
// Pass all feed objects to an array
$feedItemsArrayb]$i[/b = $feedElements[$key];
$i++;
}
}
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
11 years 9 months ago #51470
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Re: BUG - Please fix it
This is not a proper fix. An update is on the way.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- n00bster
- Offline
- New Member
Less
More
- Posts: 6
11 years 9 months ago #51471
by n00bster
Replied by n00bster on topic Re: BUG - Please fix it
hi fotis, when do you plan to publish this update?This is not a proper fix. An update is on the way.
Please Log in or Create an account to join the conversation.
- n00bster
- Offline
- New Member
Less
More
- Posts: 6
11 years 9 months ago #51472
by n00bster
Replied by n00bster on topic Re: BUG - Please fix it
any news about the update?
Please Log in or Create an account to join the conversation.
- innocence
- Offline
- New Member
Less
More
- Posts: 16
11 years 9 months ago #51473
by innocence
+1. Awaiting news
Replied by innocence on topic Re: BUG - Please fix it
any news about the update?
+1. Awaiting news
Please Log in or Create an account to join the conversation.
- Robert Ruggiero
- Offline
- New Member
Less
More
- Posts: 7
11 years 8 months ago #51474
by Robert Ruggiero
Replied by Robert Ruggiero on topic Re: BUG - Please fix it
I had the same problem on my 2.5 site and I just used the helper.php from the 1.5 version and it worked.
Please Log in or Create an account to join the conversation.
- n00bster
- Offline
- New Member
Less
More
- Posts: 6
11 years 8 months ago #51475
by n00bster
Replied by n00bster on topic Re: BUG - Please fix it
i think this is not the best idea, the files have a lot differences (1.5 > 2.5)
i hope they fix this date problem soon ...
i hope they fix this date problem soon ...
Please Log in or Create an account to join the conversation.