?
avatar waader
waader
19 Oct 2019

Steps to reproduce the issue

In Backend add a menu item for menu type Privacy > Create Request and in frontend visit this menu item. You will find that several language strings like

  • PLG_SYSTEM_PRIVACYCONSENT_REDIRECT_MESSAGE_DEFAULT
  • PLG_SYSTEM_PRIVACYCONSENT_LABEL
  • PLG_SYSTEM_PRIVACYCONSENT_FIELD_LABEL *
    etc. are untranslated.

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar waader waader - open - 19 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 19 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Oct 2019
avatar brianteeman
brianteeman - comment - 22 Oct 2019

The correct language file is not being loaded - looking at it now

avatar brianteeman
brianteeman - comment - 22 Oct 2019

@infograf768 could you take a look please as I dont really understand the plugin language files. Basically the language file for the plugin is not being loaded

avatar infograf768
infograf768 - comment - 22 Oct 2019
  1. No need to create the menu item. Only necessary to enable that system plugin and try to login.
  2. Looks like $autoloadLanguage = true; is not working for this plugin. Using $this->loadLanguage(); works better but would still not translate the Notice depending where it is placed. Maybe should be done like actionlogs with a public function onAfterInitialise() method

I guess 4.0 has changed something somewhere.

avatar mbabker
mbabker - comment - 22 Oct 2019

It’s a known issue with system plugins and that onBeforeExecute event I have said just needs flat out reverted. There’s an issue still open that still hasn’t been addressed.

avatar mbabker
mbabker - comment - 22 Oct 2019

Duplicate of #17444

avatar richard67
richard67 - comment - 22 Oct 2019

Wow, #17444 is an unresolved release blocker from August 2017 with last activity January this year. Seems that was forgotten somehow? Ping @wilsonge .

avatar infograf768
infograf768 - comment - 23 Oct 2019

In the mean while it looks like this patch solves the issue (same code as in actionlogs as stated above.:

diff --git a/plugins/system/privacyconsent/privacyconsent.php b/plugins/system/privacyconsent/privacyconsent.php
index 82926e4..4fb949a 100644
--- a/plugins/system/privacyconsent/privacyconsent.php
+++ b/plugins/system/privacyconsent/privacyconsent.php
@@ -33,12 +33,4 @@
 {
 	/**
-	 * Load the language file on instantiation.
-	 *
-	 * @var    boolean
-	 * @since  3.9.0
-	 */
-	protected $autoloadLanguage = true;
-
-	/**
 	 * Application object.
 	 *
@@ -72,4 +64,17 @@
 
 	/**
+	 * Listener for the `onAfterInitialise` event
+	 *
+	 * @return  void
+	 *
+	 * @since   4.0
+	 */
+	public function onAfterInitialise()
+	{
+		// Load plugin language files.
+		$this->loadLanguage();
+	}
+
+	/**
 	 * Adds additional fields to the user editing form
 	 *

@waader
Can you test?

avatar brianteeman
brianteeman - comment - 23 Oct 2019

This looks like the fix I had to do in other plugins so it should be good to go BUT the root issue will need to be fixed as it will break lots of plugins

avatar waader
waader - comment - 23 Oct 2019

@infograf768: Yes, that works.

avatar SharkyKZ SharkyKZ - change - 26 Nov 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-11-26 09:38:33
Closed_By SharkyKZ
avatar joomla-cms-bot joomla-cms-bot - change - 26 Nov 2019
Closed_By SharkyKZ joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 26 Nov 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 26 Nov 2019

Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/26715

avatar SharkyKZ
SharkyKZ - comment - 26 Nov 2019

Please test PR #27155.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26715.

Add a Comment

Login with GitHub to post a comment