?
avatar infograf768
infograf768
17 Oct 2020

Steps to reproduce the issue

Looks like a normal behavior for any plugin, BUT the strings need to be loaded when the Action Logs - Latest module is displayed in backend (usually in CPanel)

Expected result

Screen Shot 2020-10-17 at 10 06 26

Actual result

Screen Shot 2020-10-17 at 10 07 05

Only solution I found was to add in joomla.ini the strings concerned:

; Common content type log messages
PLG_SYSTEM_ACTIONLOGS_CONTENT_ADDED="User <a href=\"{accountlink}\">{username}</a> added new {type} <a href=\"{itemlink}\">{title}</a>"
PLG_SYSTEM_ACTIONLOGS_CONTENT_ARCHIVED="User <a href=\"{accountlink}\">{username}</a> archived the {type} <a href=\"{itemlink}\">{title}</a>"
PLG_SYSTEM_ACTIONLOGS_CONTENT_DELETED="User <a href=\"{accountlink}\">{username}</a> deleted the {type} {title}"
PLG_SYSTEM_ACTIONLOGS_CONTENT_PUBLISHED="User <a href=\"{accountlink}\">{username}</a> published the {type} <a href=\"{itemlink}\">{title}</a>"
PLG_SYSTEM_ACTIONLOGS_CONTENT_TRASHED="User <a href=\"{accountlink}\">{username}</a> trashed the {type} <a href=\"{itemlink}\">{title}</a>"
PLG_SYSTEM_ACTIONLOGS_CONTENT_UNPUBLISHED="User <a href=\"{accountlink}\">{username}</a> unpublished the {type} <a href=\"{itemlink}\">{title}</a>"
PLG_SYSTEM_ACTIONLOGS_CONTENT_UPDATED="User <a href=\"{accountlink}\">{username}</a> updated the {type} <a href=\"{itemlink}\">{title}</a>"

Any better idea?

avatar infograf768 infograf768 - open - 17 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Oct 2020
avatar brianteeman
brianteeman - comment - 19 Dec 2020

Wont your proposal mean that the same has to be done for all the actionlog plugins? And even if that is done it would not solve the issue for any 3pd actionlog plugins

avatar infograf768
infograf768 - comment - 20 Dec 2020

We indeed need another way, this is why I did not make a PR but an issue.

avatar infograf768
infograf768 - comment - 20 Dec 2020

I found a solution.

ActionlogsHelper::loadActionLogPluginsLanguage(); is loading ONLY the language files of the actionlogs plugins (enabled or disabled) which are in the actionlog folder.
It totally ignores the actionlogs system plugin.

We have

public static function loadActionLogPluginsLanguage()
{
$lang = Factory::getLanguage();
$db = Factory::getDbo();
// Get all (both enabled and disabled) actionlog plugins
$query = $db->getQuery(true)
->select(
$db->quoteName(
array(
'folder',
'element',
'params',
'extension_id'
),
array(
'type',
'name',
'params',
'id'
)
)
)
->from('#__extensions')
->where('type = ' . $db->quote('plugin'))
->where('folder = ' . $db->quote('actionlog'))
->where('state IN (0,1)')
->order('ordering');
$db->setQuery($query);

It forces loading com_privacy language file though.

Shall not we also force plg_system_actionlogs.ini lang file?

If I add

		// Load plg_system_actionlogs too
		$lang->load('plg_system_actionlogs', JPATH_ADMINISTRATOR);

issue solved.

@wilsonge @HLeithner
What do you think?

avatar HLeithner
HLeithner - comment - 20 Dec 2020

Since we have already this method it looks straight forward to add the system plugin to it.

avatar infograf768
infograf768 - comment - 20 Dec 2020

tks, will do

avatar infograf768 infograf768 - change - 21 Dec 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-12-21 07:56:11
Closed_By infograf768
avatar infograf768 infograf768 - close - 21 Dec 2020
avatar infograf768
infograf768 - comment - 21 Dec 2020

Closing as we have a patch #31745

Add a Comment

Login with GitHub to post a comment