? Pending

User tests: Successful: Unsuccessful:

avatar ervindeak
ervindeak
5 Nov 2020

Language::load() also checks, and that works better.

Pull Request for Issue #31311 .

Testing/reproduction

I found the issue in the following situation:
I have a component which have settings for users (at user profile, via plugin) and one of these can be changed temporary for a specific item. The UI for changing default value and for the temporary change shares the same code, and same language file.
Because the plugin works with user profile I can edit it's value both frontend and backend. For some reason (probably custom field types in admin folder) on the admin side it loads the components admin language file, which prevents the loading of frontend language file if CMSPlugin checks if there is any file loaded for the extension.

avatar ervindeak ervindeak - open - 5 Nov 2020
avatar ervindeak ervindeak - change - 5 Nov 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Nov 2020
Category Libraries
avatar ervindeak ervindeak - change - 5 Nov 2020
The description was changed
avatar ervindeak ervindeak - edited - 5 Nov 2020
avatar brianteeman
brianteeman - comment - 5 Nov 2020

Aren't all plugin language files located in the admin language folder?

avatar ervindeak
ervindeak - comment - 5 Nov 2020

Aren't all plugin language files located in the admin language folder?

Actually it should load the components language file. Because that's used for UI, generating content, ect. The plugin basically only for show/edit the user's settings in the user's profile. It's not a standalone plugin.

avatar infograf768
infograf768 - comment - 5 Nov 2020

The matter is not the loading of the plugin lang file, but the loading of the component site lang file by the plugin.

avatar infograf768
infograf768 - comment - 5 Nov 2020

oops, OP already replied. :)

avatar infograf768
infograf768 - comment - 27 Mar 2021

The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepath

avatar ervindeak
ervindeak - comment - 27 Mar 2021

The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepath

Watch the removed lines. It doesn't care with $basePath if any lang file loaded from the same plugin. I want to use both frontend and backend lang files, but those lines makes it impossible.

avatar ervindeak
ervindeak - comment - 27 Mar 2021

The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepath

Watch the removed lines. It doesn't care with $basePath if any lang file loaded from the same plugin. I want to use both frontend and backend lang files, but those lines makes it impossible.

Also, Joomla loads all admin lang files of the extensions, so loading a frontend file from a component is problematic from the admin side via plugins. Of course I can use Language::load(), but then there's no real reason for the existence of Plugin::loadLanguage()

avatar zero-24
zero-24 - comment - 21 Jul 2022

The Plugin::loadLanguage() loads the plugins language file but you can use Language::load() to load the component language file. I dont intent to change this behavior within J3. I would recommend to check whether the current status of J4 is still the same, get it tested and get it fixed there

avatar zero-24 zero-24 - change - 21 Jul 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-07-21 17:11:07
Closed_By zero-24
Labels Added: ?
avatar zero-24 zero-24 - close - 21 Jul 2022

Add a Comment

Login with GitHub to post a comment