From 88560c6bf6235352a45a689c1d3b014fec5f5ff8 Mon Sep 17 00:00:00 2001 From: Reconix Date: Mon, 31 Aug 2020 23:54:55 +0100 Subject: [PATCH] Revert "Fix feed image (#29237)" This reverts commit 9ee8845389ef7627f4a9d2dd644def6698463cc9. --- .../modules/mod_feed/tmpl/default.php | 7 ++++-- .../views/newsfeed/tmpl/default.php | 4 ++-- libraries/src/Feed/Feed.php | 22 +++++++++---------- modules/mod_feed/tmpl/default.php | 7 ++++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/administrator/modules/mod_feed/tmpl/default.php b/administrator/modules/mod_feed/tmpl/default.php index 6ae383d5873c7..d52b5708808d2 100644 --- a/administrator/modules/mod_feed/tmpl/default.php +++ b/administrator/modules/mod_feed/tmpl/default.php @@ -49,6 +49,9 @@ } if ($feed != false) : + // Image handling + $iUrl = isset($feed->image) ? $feed->image : null; + $iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null; ?>
- get('rssimage', 1) && $feed->image) : ?> - <?php echo $feed->image->title; ?> + get('rssimage', 1) && $iUrl) : ?> + <?php echo @$iTitle; ?> diff --git a/components/com_newsfeeds/views/newsfeed/tmpl/default.php b/components/com_newsfeeds/views/newsfeed/tmpl/default.php index e9b04a47abfe2..fca1e84eacfef 100644 --- a/components/com_newsfeeds/views/newsfeed/tmpl/default.php +++ b/components/com_newsfeeds/views/newsfeed/tmpl/default.php @@ -79,9 +79,9 @@
- rssDoc->image && $this->params->get('show_feed_image')) : ?> + rssDoc->image, $this->rssDoc->imagetitle) && $this->params->get('show_feed_image')) : ?>
- <?php echo $this->rssDoc->image->title; ?> + <?php echo $this->rssDoc->image->decription; ?>
diff --git a/libraries/src/Feed/Feed.php b/libraries/src/Feed/Feed.php index 5f36a22d87a5a..341e35a10d768 100644 --- a/libraries/src/Feed/Feed.php +++ b/libraries/src/Feed/Feed.php @@ -15,17 +15,17 @@ /** * Class to encapsulate a feed for the Joomla Platform. * - * @property FeedPerson $author Person responsible for feed content. - * @property array $categories Categories to which the feed belongs. - * @property array $contributors People who contributed to the feed content. - * @property string $copyright Information about rights, e.g. copyrights, held in and over the feed. - * @property string $description A phrase or sentence describing the feed. - * @property string $generator A string indicating the program used to generate the feed. - * @property FeedLink|null $image FeedLink object containing feed image properties. - * @property Date $publishedDate The publication date for the feed content. - * @property string $title A human readable title for the feed. - * @property Date $updatedDate The last time the content of the feed changed. - * @property string $uri Universal, permanent identifier for the feed. + * @property FeedPerson $author Person responsible for feed content. + * @property array $categories Categories to which the feed belongs. + * @property array $contributors People who contributed to the feed content. + * @property string $copyright Information about rights, e.g. copyrights, held in and over the feed. + * @property string $description A phrase or sentence describing the feed. + * @property string $generator A string indicating the program used to generate the feed. + * @property string $image Specifies a GIF, JPEG or PNG image that should be displayed with the feed. + * @property Date $publishedDate The publication date for the feed content. + * @property string $title A human readable title for the feed. + * @property Date $updatedDate The last time the content of the feed changed. + * @property string $uri Universal, permanent identifier for the feed. * * @since 3.1.4 */ diff --git a/modules/mod_feed/tmpl/default.php b/modules/mod_feed/tmpl/default.php index ddd30ed5bb836..bc24d9e7cfda0 100644 --- a/modules/mod_feed/tmpl/default.php +++ b/modules/mod_feed/tmpl/default.php @@ -54,6 +54,9 @@ if ($feed !== false) { + // Image handling + $iUrl = isset($feed->image) ? $feed->image : null; + $iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null; ?>
image && $params->get('rssimage', 1)) : + if ($iUrl && $params->get('rssimage', 1)) : ?> - <?php echo $feed->image->title; ?> + <?php echo @$iTitle; ?>