No Code Attached Yet bug
avatar brockpalen
brockpalen
29 Aug 2022

Steps to reproduce the issue

  1. Create new Feed Display module
  2. Set Feed URL to a Blogger Atom Feed eg https://www.failureasaservice.com/feeds/posts/default

Expected result

Links should use the <link rel="alternate"> entry creating a clickable jump back to the Blogger page.

Actual result

Link is created using the first entry <link rel="replies"> which is an XML feed and not useful for normal users who just want to jump over to your post on Blogger.com.

<link rel="replies" type="application/atom+xml" href="https://www.failureasaservice.com/feeds/921417709640098202/comments/default" title="Post Comments"/>
    <link rel="replies" type="text/html" href="https://www.failureasaservice.com/2020/10/amd-killed-arm-in-data-center.html#comment-form" title="0 Comments"/>
    <link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/3991757369876144735/posts/default/921417709640098202"/>
    <link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/3991757369876144735/posts/default/921417709640098202"/>
    <link rel="alternate" type="text/html" href="https://www.failureasaservice.com/2020/10/amd-killed-arm-in-data-center.html" title="AMD Killed ARM in the Data Center"/>

System information (as much as possible)

Joomla 4.1.5

Additional comments

The Blogger.com feed validates over at W3C,

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar brockpalen brockpalen - open - 29 Aug 2022
avatar brockpalen brockpalen - change - 29 Aug 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 29 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Aug 2022
avatar brockpalen
brockpalen - comment - 30 Dec 2022

Ok figured out some what is going on,

AtomParser.php in with newer versions of PHP (assumption) doesn't behave as expected,

Specificaly in processFeedEntry it has

if (\is_array($link))

But that won't work because it returns an instance of SimpleXMLElement and not an array so the first entry it taken.

If it's changed to:

if ($link->count() > 1)

It now enters the IF statement correctly for bestLInkForUri Note it also needs to have it's prototype updated to be

private function bestLinkForUri(\SimpleXMLElement $links)

Rather than array or it will error.

Lastly

$linkPrefs = array('', 'self', 'alternate');

Needs to be updated to

$linkPrefs = array('alternate', 'self', '');

To get the expected behavior. Not sure everyone wants that behavior and it should probably be changed to a param? Not sure.

Lastly title links have the same issues and in AtomParser.php again

protected function handleLink(Feed $feed, \SimpleXMLElement $el)

Grabs just the first link which again isn't least astonishment behavior on Blgoger generated feeds. I just disabled showing the title.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38631.
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Hackwar Hackwar - change - 24 Jan 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-01-24 21:53:34
Closed_By Hackwar
avatar Hackwar Hackwar - close - 24 Jan 2024
avatar Hackwar
Hackwar - comment - 24 Jan 2024

Thank you for your reported issue and all the work you did. I created a PR out of this. Please test the PR #42706 and then can this be fixed in one of the next releases.

Closing issue since we have a PR.

avatar brockpalen
brockpalen - comment - 28 Jan 2024

Great thanks, I just tested the change and it works perfectly. Appreciate it.


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

avatar Hackwar
Hackwar - comment - 29 Jan 2024

Can you please mark the PR as tested by you? We need 2 successfull tests to be able to merge this and with yours we would be done. ?

avatar brockpalen
brockpalen - comment - 29 Jan 2024

So not sure if this is the right place but a quick google all I find is this page:

https://docs.joomla.org/Testing_Joomla!_patches

And I don't see a TestThis, so I'm not sure how you want me to flag that. Sorry first time reporting.


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

Add a Comment

Login with GitHub to post a comment