2 times uk gallery
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?
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.