From 9d8f161d1deaf5f589304cdc97a2e373c29431a4 Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Tue, 2 Sep 2025 13:24:02 +0200 Subject: [PATCH 1/6] removal deprecated helper --- components/com_content/helpers/icon.php | 130 ------------------------ 1 file changed, 130 deletions(-) delete mode 100644 components/com_content/helpers/icon.php diff --git a/components/com_content/helpers/icon.php b/components/com_content/helpers/icon.php deleted file mode 100644 index 9906ef941646..000000000000 --- a/components/com_content/helpers/icon.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - * - * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace - */ - -use Joomla\CMS\Language\Text; -use Joomla\Registry\Registry; - -// phpcs:disable PSR1.Files.SideEffects -\defined('_JEXEC') or die; -// phpcs:enable PSR1.Files.SideEffects - -/** - * Content Component HTML Helper - * - * @since 1.5 - * - * @deprecated 4.3 will be removed in 6.0 - * Use the class \Joomla\Component\Content\Administrator\Service\HTML\Icon instead - */ -abstract class JHtmlIcon -{ - /** - * Method to generate a link to the create item page for the given category - * - * @param object $category The category information - * @param Registry $params The item parameters - * @param array $attribs Optional attributes for the link - * @param boolean $legacy True to use legacy images, false to use icomoon based graphic - * - * @return string The HTML markup for the create item link - * - * @deprecated 4.3 will be removed in 6.0 - * Use \Joomla\Component\Content\Administrator\Service\HTML\Icon::create instead - * Example: - * use Joomla\Component\Content\Administrator\Service\HTML\Icon; - * Factory::getContainer()->get(Registry::class)->register('icon', new Icon()); - * echo HTMLHelper::_('icon.create', ...); - */ - public static function create($category, $params, $attribs = [], $legacy = false) - { - return self::getIcon()->create($category, $params, $attribs, $legacy); - } - - /** - * Display an edit icon for the article. - * - * This icon will not display in a popup window, nor if the article is trashed. - * Edit access checks must be performed in the calling code. - * - * @param object $article The article information - * @param Registry $params The item parameters - * @param array $attribs Optional attributes for the link - * @param boolean $legacy True to use legacy images, false to use icomoon based graphic - * - * @return string The HTML for the article edit icon. - * - * @since 1.6 - * - * @deprecated 4.3 will be removed in 6.0 - * Use \Joomla\Component\Content\Administrator\Service\HTML\Icon::edit instead - * Example: - * use Joomla\Component\Content\Administrator\Service\HTML\Icon; - * Factory::getContainer()->get(Registry::class)->register('icon', new Icon()); - * echo HTMLHelper::_('icon.edit', ...); - */ - public static function edit($article, $params, $attribs = [], $legacy = false) - { - return self::getIcon()->edit($article, $params, $attribs, $legacy); - } - - /** - * Method to generate a popup link to print an article - * - * @param object $article The article information - * @param Registry $params The item parameters - * @param array $attribs Optional attributes for the link - * @param boolean $legacy True to use legacy images, false to use icomoon based graphic - * - * @return string The HTML markup for the popup link - * - * @deprecated 4.3 will be removed in 6.0 - * No longer used, will be removed without replacement - */ - public static function print_popup($article, $params, $attribs = [], $legacy = false) - { - throw new \Exception(Text::_('COM_CONTENT_ERROR_PRINT_POPUP')); - } - - /** - * Method to generate a link to print an article - * - * @param object $article Not used - * @param Registry $params The item parameters - * @param array $attribs Not used - * @param boolean $legacy True to use legacy images, false to use icomoon based graphic - * - * @return string The HTML markup for the popup link - * - * @deprecated 4.3 will be removed in 6.0 - * Use \Joomla\Component\Content\Administrator\Service\HTML\Icon::print_screen instead - * Example: - * use Joomla\Component\Content\Administrator\Service\HTML\Icon; - * Factory::getContainer()->get(Registry::class)->register('icon', new Icon()); - * echo HTMLHelper::_('icon.print_screen', ...); - */ - public static function print_screen($article, $params, $attribs = [], $legacy = false) - { - return self::getIcon()->print_screen($params, $legacy); - } - - /** - * Creates an icon instance. - * - * @return \Joomla\Component\Content\Administrator\Service\HTML\Icon - * - * @deprecated 4.3 will be removed in 6.0 without replacement - */ - private static function getIcon() - { - return new \Joomla\Component\Content\Administrator\Service\HTML\Icon(Joomla\CMS\Factory::getApplication()); - } -} From 9791c5e6ef3729d31a1fb42bde49b02459b93877 Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Tue, 2 Sep 2025 13:24:24 +0200 Subject: [PATCH 2/6] removal lang string attached to deprecated helper --- language/en-GB/com_content.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/language/en-GB/com_content.ini b/language/en-GB/com_content.ini index f13e91022af8..0c1d56c15662 100644 --- a/language/en-GB/com_content.ini +++ b/language/en-GB/com_content.ini @@ -25,7 +25,6 @@ COM_CONTENT_EDIT_UNPUBLISHED_ARTICLE="Unpublished Article" COM_CONTENT_ERROR_ARTICLE_NOT_FOUND="Article not found" COM_CONTENT_ERROR_LOGIN_TO_VIEW_ARTICLE="Please login to view the article" COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND="Parent category not found" -COM_CONTENT_ERROR_PRINT_POPUP="Sorry, Joomla no longer supports print_popup" COM_CONTENT_ERROR_UNIQUE_ALIAS="Another Article in this category has the same alias." COM_CONTENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Article in this category has the same alias." COM_CONTENT_FEED_READMORE="Read More …" From 278b7bbfd4a443f67add789b6a2a4d459df81c01 Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Tue, 2 Sep 2025 13:24:40 +0200 Subject: [PATCH 3/6] removal deprecated function print_screen --- .../com_content/src/Service/HTML/Icon.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index fe1782260de4..02521ed03936 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -135,21 +135,4 @@ public function edit($article, $params, $attribs = [], $legacy = false) return $output; } - - /** - * Method to generate a link to print an article - * - * @param Registry $params The item parameters - * @param boolean $legacy True to use legacy images, false to use icomoon based graphic - * - * @return string The HTML markup for the popup link - * - * @since 4.0.0 - */ - public function print_screen($params, $legacy = false) - { - $text = LayoutHelper::render('joomla.content.icons.print_screen', ['params' => $params, 'legacy' => $legacy]); - - return ''; - } } From b48cba9932686745ec551bca0ea23ee6603b719b Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Sat, 4 Oct 2025 14:38:30 +0200 Subject: [PATCH 4/6] revert removal of function --- .../com_content/src/Service/HTML/Icon.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index 02521ed03936..fe1782260de4 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -135,4 +135,21 @@ public function edit($article, $params, $attribs = [], $legacy = false) return $output; } + + /** + * Method to generate a link to print an article + * + * @param Registry $params The item parameters + * @param boolean $legacy True to use legacy images, false to use icomoon based graphic + * + * @return string The HTML markup for the popup link + * + * @since 4.0.0 + */ + public function print_screen($params, $legacy = false) + { + $text = LayoutHelper::render('joomla.content.icons.print_screen', ['params' => $params, 'legacy' => $legacy]); + + return ''; + } } From 8462b6844f2440a18cc66696042ddbb8dae6fa5f Mon Sep 17 00:00:00 2001 From: Hans Kuijpers Date: Sat, 4 Oct 2025 14:39:09 +0200 Subject: [PATCH 5/6] Add deprecated warning as it is our policy to deprecate before removal --- administrator/components/com_content/src/Service/HTML/Icon.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index fe1782260de4..5efb212d728b 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -144,7 +144,8 @@ public function edit($article, $params, $attribs = [], $legacy = false) * * @return string The HTML markup for the popup link * - * @since 4.0.0 + * @since 4.0.0 + * @deprecated 6.0 will be removed in 7.0 without replacement */ public function print_screen($params, $legacy = false) { From 8fd419f728ca8dba75b3ebd04a6420791133bcb3 Mon Sep 17 00:00:00 2001 From: Harald Leithner Date: Mon, 8 Dec 2025 22:39:46 +0100 Subject: [PATCH 6/6] Apply suggestion from @bembelimen Co-authored-by: Benjamin Trenkle --- administrator/components/com_content/src/Service/HTML/Icon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index 5efb212d728b..61e7f5b1a3f9 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -145,7 +145,7 @@ public function edit($article, $params, $attribs = [], $legacy = false) * @return string The HTML markup for the popup link * * @since 4.0.0 - * @deprecated 6.0 will be removed in 7.0 without replacement + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 without replacement */ public function print_screen($params, $legacy = false) {