User tests: Successful: Unsuccessful:
Pull Request for Issue #15348.
Per the issue #15348, there are issues when displaying some Atom feeds in Joomla.
For some feeds (examples: https://code.tutsplus.com/categories/php.atom, http://planet.debian.org/atom.xml ), the feed is rendered in Joomla with only the titles, and no content.
This is due to the feed items not containing a summary
element. It does, however have a content
element. I have therefore made a change to the feed parser such that if the summary
is found to be missing, it will fall-back to using the content
instead.
For many Atom feeds (examples: https://www.gov.uk/government/organisations/home-office.atom, https://www.theregister.co.uk/headlines.atom), when the feed items are displayed in Joomla, the title link points to the main feed URL instead of the URL for the article. In fact most Atom feeds that I've tried exhibit this behaviour.
This is due to the fact that the Atom feed parser is assuming that the id
element in each feed item will contain a valid URL for the source article. This is not usually the case; the id
element generally does contain a unique identifier, but it is often not a URL. The actual URL that we should be linking to is usually contained within a link
element within the item.
I have therefore made changes to the feed parser such that if the ID is found not to contain a valid URL, then we fall-back to the link
elements.
Most feeds only have a single link
element per item, but this change also takes into account the fact that some feeds may have multiple link
elements per item, distinguished by different rel
attributes. In this case, the parser will attempt to find the best one to use -- this is generally the one without a rel
attribute at all or with rel="alternate"
. NB: I have not found any live feeds that triggered this code, but I used the example XML on Wikipedia as a reference.
With the changes in place, TutsPlus and Debian feeds show the item contents as well as just the headlines.
With the changes in place, the headlines in the Home Office and The Register feeds can be clicked to link to the articles.
Before the changes, TutsPlus and Debian feeds only show headlines.
Before the changes, clicking article headlines on the Home Office and The Register feeds takes you to the atom newsfeed itself rather than the article.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
Test on given 4 Url:
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-26 17:58:12 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
I have tested this item✅ successfully on a70064a
Confirmed both issues with the sample atom feeds
Confirmed the PR fixes both issues - thanks
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16105.