Skip to content

Commit a3528df

Browse files
authored
Merge branch '5.3-dev' into ghactions
2 parents a9c6af6 + 3b8c49e commit a3528df

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

administrator/components/com_finder/src/Helper/LanguageHelper.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Joomla\CMS\Factory;
1414
use Joomla\CMS\Language\LanguageHelper as CMSLanguageHelper;
1515
use Joomla\CMS\Language\Text;
16+
use Joomla\CMS\Plugin\PluginHelper;
1617

1718
// phpcs:disable PSR1.Files.SideEffects
1819
\defined('_JEXEC') or die;
@@ -123,16 +124,8 @@ public static function loadPluginLanguage()
123124

124125
$loaded = true;
125126

126-
// Get array of all the enabled Smart Search plugin names.
127-
$db = Factory::getDbo();
128-
$query = $db->getQuery(true)
129-
->select([$db->quoteName('name'), $db->quoteName('element')])
130-
->from($db->quoteName('#__extensions'))
131-
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
132-
->where($db->quoteName('folder') . ' = ' . $db->quote('finder'))
133-
->where($db->quoteName('enabled') . ' = 1');
134-
$db->setQuery($query);
135-
$plugins = $db->loadObjectList();
127+
// Get array of all the enabled Smart Search plugins.
128+
$plugins = PluginHelper::getPlugin('finder');
136129

137130
if (empty($plugins)) {
138131
return;
@@ -144,8 +137,9 @@ public static function loadPluginLanguage()
144137

145138
// Load language file for each plugin.
146139
foreach ($plugins as $plugin) {
147-
$lang->load($plugin->name, JPATH_ADMINISTRATOR)
148-
|| $lang->load($plugin->name, JPATH_PLUGINS . '/finder/' . $plugin->element);
140+
$extension = 'plg_finder_' . $plugin->name;
141+
$lang->load($extension, JPATH_ADMINISTRATOR)
142+
|| $lang->load($extension, JPATH_PLUGINS . '/finder/' . $plugin->name);
149143
}
150144
}
151145
}

0 commit comments

Comments
 (0)