2 times uk gallery

2 times uk gallery was created by thabar

Posted 6 hours 1 minute ago #36485
Hello!  

I had the warning on a site with 2 time UK gallery:

Warning: Cannot declare class TextCompat, because the name is already in use in mod_uk_gallery/tmpl/default.php on line 13

The i changed modules/mod_uk_gallery/tmpl/default.php

from

// Joomla 6 compatibility: Detect and alias classes
if (class_exists('Joomla\CMS\Language\Text')) {
    // Joomla 3/4/5 or with compatibility plugin
    class_alias('Joomla\CMS\Language\Text', 'TextCompat');
} else {
    // Joomla 6 without compatibility plugin
    class_alias('Joomla\Language\Text', 'TextCompat');
}
to:

// Only create the alias if it hasn't been defined yet
if (!class_exists('TextCompat')) {
    if (class_exists('Joomla\CMS\Language\Text')) {
        // Joomla 3/4/5 or with compatibility plugin
        class_alias('Joomla\CMS\Language\Text', 'TextCompat');
    } else {
        // Joomla 6 without compatibility plugin
        class_alias('Joomla\Language\Text', 'TextCompat');
    }
}

this fixes the Problem.

Can you add it in futre Updates?
by thabar

Please Log in or Create an account to join the conversation.

Installations-Service

Don´t waste your time, we install your purchased Template
with the "Demo Content" within the next 24 hours.

Buy Now - 59€

JoomlaPlates

Professional Joomla Templates with rich documentation and support since 2008. 60+ templates for Joomla 5 & 6.

Joomla 4 Joomla 5 Joomla 6
Contact & Legal
  • support@joomlaplates.com
  • Support Team
  • Mon-Fri: 9:00-18:00 CET

© JoomlaPlates. All rights reserved. 2008 - 2026

JoomlaPlates is not affiliated with or endorsed by the Joomla! Project. Joomla! is a registered trademark of Open Source Matters, Inc.