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.
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"
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)
Joomla 3.6.5 with PHP 5.6 or 7.x
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.
Labels |
Added:
?
|
Build | staging | ⇒ | 3.6.5 |
Category | ⇒ | com_newsfeeds |
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
Status | New | ⇒ | Confirmed |
I can confirm this issue -- I'm having the same problem with several atom feeds.
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?
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.
closed as having PR #16105
Closed_Date | 2017-05-26 10:47:42 | ⇒ | 2017-05-26 10:47:43 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-26 10:47:42 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15348
I suspect it is because of the errors stated on the following links regarding iframes
https://www.feedvalidator.org/check.cgi?url=https%3A%2F%2Fcode.tutsplus.com%2Fcategories%2Fphp.atom
https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fcode.tutsplus.com%2Fcategories%2Fphp.atom