Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Fix for missing Fulltext Image in Newsfeeds #38058

Open
wants to merge 35 commits into
base: 5.3-dev
Choose a base branch
from

Conversation

AndySDH
Copy link
Contributor

@AndySDH AndySDH commented Jun 14, 2022

As requested, Joomla 4.2 re-do of Pull Request #28195

Summary of Changes

Originally Joomla RSS Newsfeeds were completely missing the image_intro and image_fulltext. This was partially fixed with this PR: #11402

But that only introduced the image_intro, and forgot the image_fulltext.

So an article that had an image_fulltext would not use that image in the feed.

This PR simply adds the image_fulltext to the feed if the image_intro is empty, for both the category view and featured view.

@richard67
Copy link
Member

@AndySDH Could you fix the code style errors reported by drone here https://ci.joomla.org/joomla/joomla-cms/55308/1/6 ? Thanks in advance.

@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 14, 2022

@richard67 Should be done :)

@richard67
Copy link
Member

@richard67 Should be done :)

@AndySDH Not really. There are still some complaints: https://ci.joomla.org/joomla/joomla-cms/55316/1/6

@richard67
Copy link
Member

@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 14, 2022

Well it's going in circles a bit. If I take out those spaces, the indentation will look off. I'm not sure that's a valid complaint there, not sure.

@richard67
Copy link
Member

Well it's going in circles a bit. If I take out those spaces, the indentation will look off. I'm not sure that's a valid complaint there, not sure.

@AndySDH It is a valid complaint. The indentation of the “=“ and the lines below do not need to be aligned. Furthermore the lines below should be indented with tabs. I would also suggest to put the operators “?” and “:” of the ternaries to the beginning of a line and not the end of the previous line. And I would indent the 2nd ternary by one tab more than the first one. Maybe check how it is done elsewhere.

@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 13, 2024

Hey there, can this please be merged?

@brianteeman
Copy link
Contributor

You need to fic the codestyle issues https://ci.joomla.org/joomla/joomla-cms/76705/1/7

@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 13, 2024

How do I fix? Didn't it use to be automatic with the click of a button? Can't see it anymore

@brianteeman
Copy link
Contributor

How do I fix? Didn't it use to be automatic with the click of a button? Can't see it anymore

No you have to fix it in your branch and push the changes

@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 13, 2024

And what is the fix I need to make? I can't tell from the phpcs log, it's not very clear.

Co-authored-by: Brian Teeman <brian@teeman.net>
@AndySDH
Copy link
Contributor Author

AndySDH commented Jun 13, 2024

Thank you, committed :)

@zero-24 zero-24 removed their request for review June 13, 2024 13:17
@brianteeman
Copy link
Contributor

Could someone please retrigger drone so we can see what its failing on

@Quy Quy removed the PR-5.0-dev label Aug 30, 2024
@fgsw
Copy link

fgsw commented Aug 30, 2024

Using menu item type "Category Blog" for a feed works as described.

Using menu item type "Featured Articles" for a feed give The requested page can't be found.:

0 No registered feed parser for type error.

Call Stack

# Function Location
1 () JROOT/libraries/src/Feed/FeedFactory.php:148
2 Joomla\CMS\Feed\FeedFactory->_fetchFeedParser() JROOT/libraries/src/Feed/FeedFactory.php:84
3 Joomla\CMS\Feed\FeedFactory->getFeed() JROOT/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php:180
4 Joomla\Component\Newsfeeds\Site\View\Newsfeed\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:697
5 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_newsfeeds/src/Controller/DisplayController.php:58
6 Joomla\Component\Newsfeeds\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:730
7 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
8 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:218
10 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:261
11 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:306
12 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:58
13 require_once() JROOT/index.php:32

Test System Information:

PHP Built On Darwin Air.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 x86_64
Database Type mysql
Database Version 8.0.35
Database Collation utf8mb4_unicode_ci
Database Connection Collation utf8mb4_0900_ai_ci
Database Connection Encryption None
Database Server Supports Connection Encryption Yes
PHP Version 8.3.8
Web Server Apache/2.4.58 (Unix) OpenSSL/1.1.1u mod_fastcgi/mod_fastcgi-SNAP-0910052141
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 5.2.0-beta2-dev Development [ Uthabiti ] 23-July-2024 16:01 GMT
Joomla Backward Compatibility Plugin Disabled
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0

@AndySDH
Copy link
Contributor Author

AndySDH commented Aug 30, 2024

@fgsw Doesn't seem related to this PR. The file changed in this PR has nothing to do with the error trace you've shown.

@@ -53,8 +53,15 @@ protected function reconcileNames($item)
$item->description = '';
$obj = json_decode($item->images);

// Ensure alt properties are set
$obj->image_intro_alt = $obj->image_intro_alt ?? '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $obj is null, then the following error:

<?xml version="1.0" encoding="UTF-8"?>
<error>
	<code>0</code>
	<message>Attempt to assign property &quot;image_intro_alt&quot; on null</message>
</error>

Checking for the alt property should not be necessary so remove the check/assignment.

PS: The code is self explanatory so these comments don't provide additional information.

@fgsw
Copy link

fgsw commented Aug 31, 2024

I have tested this item ✅ successfully on 03ec896

Prebuilt package used for test. First test was by patchtester.


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

@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev September 2, 2024 08:53
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.2] Fix for missing Fulltext Image in Newsfeeds [5.3] Fix for missing Fulltext Image in Newsfeeds Sep 2, 2024
@Quy Quy added Updates Requested Indicates that this pull request needs an update from the author and should not be tested. and removed PR-5.2-dev labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Maintainers Checked Used if the PR is conceptional useful PR-5.3-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.