enginkizil / FeedEk

FeedEk jQuery RSS/ATOM Feed Plugin
https://jquery-plugins.net/FeedEk/FeedEk.html
MIT License
207 stars 107 forks source link

Exception when MaxCount is 1 #39

Closed rolandjohann closed 5 years ago

rolandjohann commented 8 years ago

When MaxCount is 1 the response value at data.query.results.rss is not an array but an object. so the $.each won't work and an exception will be thrown because of an member access of undefined. The fix will be to insert following code at line 30:

if ((data.query.results.rss instanceof Array) !== true) {
    data.query.results.rss = [data.query.results.rss];
}
enginkizil commented 8 years ago

I couldn't test so much with YQL API after Google Feed API suddenly stopped. I ll change code soon. Thank you

BradGunnerSGT commented 7 years ago

Actually, this seems to also happen when there is just one item in the RSS feed. We have struggled with this for months because my customer has been complaining constantly about how the alerts just disappear from the page after a while.

I just realized today that their complaints coincide when there is only one alert in the RSS feed, a "pinned" alert that basically has no expiration date and it semi-permanent. Once they add a second alert, everything magically displays just fine. Once that alert expires, a few days later they notice that there are no alerts displayed.

I'm thinking that YQL is returning a single object instead of a list of objects when there is only one item in the RSS feed. I'll try to test this suggested code on a test system to see if that helps in my case as well.

enginkizil commented 5 years ago

Hello, FeedEk v3.1.0 released and YQL API is not using anymore. @rolandjohann @BradGunnerSGT could you please check if you have any error when using MaxCount is 1 ?

BradGunnerSGT commented 5 years ago

Actually, after this latest issue we realized that FeedEk was overkill for our use case so we wrote a small server-side replacement in Python on Friday.

rolandjohann commented 5 years ago

I can't test it too as I'm not in the relevant project anymore.