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
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
75ee1a8
Update FeedView.php
AndySDH Jun 14, 2022
8d11d54
Update FeedView.php
AndySDH Jun 14, 2022
59cdbb4
make phpcs happy
AndySDH Jun 14, 2022
59421be
make phpcs happy
AndySDH Jun 14, 2022
3252be5
Merge branch '4.2-dev' into patch-12
AndySDH Jun 14, 2022
215a036
Update FeedView.php
AndySDH Jun 14, 2022
dc0b151
Update FeedView.php
AndySDH Jun 14, 2022
390d210
Update FeedView.php
AndySDH Jun 14, 2022
ca184a9
Update FeedView.php
AndySDH Jun 14, 2022
4444745
Update components/com_content/src/View/Category/FeedView.php
AndySDH Jun 15, 2022
1b14f85
Update components/com_content/src/View/Featured/FeedView.php
AndySDH Jun 15, 2022
9ef3237
Make it more readable
AndySDH Jun 15, 2022
0f93b63
Make it more readable
AndySDH Jun 15, 2022
a07bfbf
Update components/com_content/src/View/Featured/FeedView.php
AndySDH Jun 15, 2022
ab15286
Update components/com_content/src/View/Category/FeedView.php
AndySDH Jun 15, 2022
3717861
Merge branch '4.2-dev' into patch-12
AndySDH Jun 15, 2022
6c8d06a
Merge tag 'psr12anchor' into psr12/merge/38058
joomla-bot Jun 27, 2022
866b35b
Phase 1 convert BRANCH to PSR-12
joomla-bot Jun 27, 2022
c9470a2
Phase 2 convert BRANCH to PSR-12
joomla-bot Jun 27, 2022
988d765
Merge tag 'psr12final' into psr12/merge/38058
joomla-bot Jun 27, 2022
3a3f20b
Update the PR with cleaner code
AndySDH Jun 17, 2023
b81bef7
Update FeedView.php
AndySDH Jun 17, 2023
26fc96c
Update FeedView.php
AndySDH Jun 17, 2023
39160d3
Update FeedView.php
AndySDH Jun 17, 2023
1669e46
Merge branch '4.3-dev' into patch-12
AndySDH Jun 17, 2023
655b354
Merge branch 'joomla:4.3-dev' into patch-12
AndySDH Sep 6, 2023
73a7562
Merge branch '5.1-dev' into patch-12
AndySDH Oct 2, 2023
1edec5d
Merge branch '5.2-dev' into patch-12
AndySDH Jun 13, 2024
f7d942c
Update components/com_content/src/View/Category/FeedView.php
AndySDH Jun 13, 2024
03ec896
Ensure alt properties are set
AndySDH Jun 15, 2024
a78558a
Ensure alt properties are set
AndySDH Jun 15, 2024
416f473
Merge branch '5.2-dev' into patch-12
richard67 Jul 25, 2024
f06aefa
Update components/com_content/src/View/Category/FeedView.php
Quy Aug 30, 2024
5cf9bff
Update components/com_content/src/View/Featured/FeedView.php
Quy Aug 30, 2024
507aca5
Merge branch '5.2-dev' into patch-12
Quy Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions components/com_content/src/View/Category/FeedView.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,21 @@ protected function reconcileNames($item)
$item->description = '';
$obj = json_decode($item->images);

if (!empty($obj->image_intro))
// Set feed image to image_intro or if that's empty, to image_fulltext
$itemImage = '';

if (!empty($obj->{'image_intro'}))
AndySDH marked this conversation as resolved.
Show resolved Hide resolved
{
$itemImage = $obj->{'image_intro'};
}
elseif (!empty($obj->{'image_fulltext'}))
{
$itemImage = $obj->{'image_fulltext'};
}

if (!empty($itemImage))
{
$item->description = '<p>' . HTMLHelper::_('image', $obj->image_intro, $obj->image_intro_alt) . '</p>';
$item->description = '<p>' . HTMLHelper::_('image', $itemImage, $obj->image_intro_alt) . '</p>';
AndySDH marked this conversation as resolved.
Show resolved Hide resolved
}

$item->description .= ($params->get('feed_summary', 0) ? $item->introtext . $item->fulltext : $item->introtext);
Expand Down
17 changes: 15 additions & 2 deletions components/com_content/src/View/Featured/FeedView.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,24 @@ public function display($tpl = null)
$link = RouteHelper::getArticleRoute($row->slug, $row->catid, $row->language);

$description = '';

$obj = json_decode($row->images);

if (!empty($obj->image_intro))
// Set feed image to image_intro or if that's empty, to image_fulltext
$itemImage = '';

if (!empty($obj->{'image_intro'}))
AndySDH marked this conversation as resolved.
Show resolved Hide resolved
{
$itemImage = $obj->{'image_intro'};
}
elseif (!empty($obj->{'image_fulltext'}))
{
$itemImage = $obj->{'image_fulltext'};
}

if (!empty($itemImage))
{
$description = '<p>' . HTMLHelper::_('image', $obj->image_intro, $obj->image_intro_alt) . '</p>';
$description = '<p>' . HTMLHelper::_('image', $itemImage, $obj->image_intro_alt) . '</p>';
}

$description .= ($params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext);
Expand Down