?
avatar Robdebert
Robdebert
17 Apr 2017

Steps to reproduce the issue

Go to the backend and create a new com_newsfeed entry with this URL: https://code.tutsplus.com/categories/php.atom

Then create a menuitem that displays this feed.

Expected result

I would expect to see the entry with a link, a description and an image, as you can see in the source-code: "view-source:https://code.tutsplus.com/categories/php.atom"

Actual result

But for some reason, only the title is outputted. A vardump/print_r output of the entry gives me this:

JFeedEntry Object
(
    [properties:protected] => Array
        (
            [uri] => tag:tutorials.tutsplus.com,2005:PostPresenter/psd-20798
            [title] => Turn a Pencil Sketch Into a Colorful and Dynamic Character Illustration
            [updatedDate] => JDate Object
                (
                    [tz:protected] => DateTimeZone Object
                        (
                            [timezone_type] => 2
                            [timezone] => GMT
                        )

                    [date] => 2017-04-14 19:51:33.322000
                    [timezone_type] => 2
                    [timezone] => Z
                )

            [content] => 
            [categories] => Array
                (
                )

            [contributors] => Array
                (
                )

            [links] => Array
                (
                )

        )

)

But i assume, that the ATOM-Format of the tuts+ page is correct, as other feed-readers are able to parse it (browser, feedly, and so on)

System information (as much as possible)

Joomla 3.6.5 with PHP 5.6 or 7.x

Additional comments

Might be a problem with this parser?
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/feed/parser/atom.php#L18

RSS-Feeds are working well, only the ATOM-Format does not.

avatar Robdebert Robdebert - open - 17 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Apr 2017
Build staging 3.6.5
avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Apr 2017
Category com_newsfeeds
avatar brianteeman
brianteeman - comment - 18 Apr 2017

scrub that commen - i tested with another atom feed http://planet.debian.org/atom.xml that doesnt have the offending iframe and it also displays just the headlines

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Apr 2017
Status New Confirmed
avatar Spudley
Spudley - comment - 17 May 2017

I can confirm this issue -- I'm having the same problem with several atom feeds.

avatar Spudley
Spudley - comment - 17 May 2017

The problem seems to be in libraries/joomla/feed/parser/atom.php processFeedEntry() method.

It sets $entry->uri = (string) $el->id. But the id property in an atom feed is not a URI.

The navigable links in an atom feed are found in <link> elements in the entry, not the <id>. There may be multiple links with different rel attributes; I would suggest that one of these should be stored in the $entry->uri property, though I guess there's a question to be answered as to which should take preference?

avatar Spudley
Spudley - comment - 17 May 2017

Sorry, I might have confused things -- there are two different issues here.

One is that the link on the title is wrong for most atom feeds (it generally ends up pointing to the main feed url rather than the article). This is the issue I described in my previous comment.

The other issue is that some feeds don't display any content other than the title. This applies to both Tutsplus and Debian feeds mentioned in this thread. The reason for this is simply that these feeds don't supply a summary element. They only have a content element.

I didn't see this issue until later as most other feeds I've looked at provide both summary and content and were working fine. It is relatively easy to fix by using the content element as a fallback if summary isn't specified. The caveat here is that content tends to be a lot longer than summary, so may not be what you want, but I guess it's better than nothing for feeds without a summary.

I'm still working on the patch; I'm trying to address both issues. The main problem I'm having is testing; I really need a supply of varied atom feeds to give it.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 May 2017

closed as having PR #16105


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15348.

avatar joomla-cms-bot joomla-cms-bot - change - 26 May 2017
Closed_Date 2017-05-26 10:47:42 2017-05-26 10:47:43
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 26 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 May 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-05-26 10:47:42
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 26 May 2017

Add a Comment

Login with GitHub to post a comment