From 6f08b233a8919539c0d245036c4c0b98307a89f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mo=C4=87ko?= Date: Sat, 8 Feb 2014 22:43:37 +0100 Subject: [PATCH 1/6] JText::script is not loading Joomla core.js JText::script should always load system JavaScript file: core.js which has declaration of function: Joomla.JText._ which should be used in JavaScript files for translating strings. If Mootools is not loaded or some other resource which is loading core.js then you will get an error trying to use: Joomla.JText._ --- libraries/joomla/language/text.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 47f308ad892d2..2f0f968e510f8 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -355,6 +355,8 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla { // Normalize the key and translate the string. self::$strings[strtoupper($string)] = JFactory::getLanguage()->_($string, $jsSafe, $interpretBackSlashes); + + JHtml::_('script', 'system/core.js', false, true); } return self::$strings; From 78aaea716b581cf9f9ed30448877f3b7b9ed2553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mo=C4=87ko?= Date: Sun, 9 Feb 2014 12:54:10 +0100 Subject: [PATCH 2/6] Update head.php --- libraries/joomla/document/html/renderer/head.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/joomla/document/html/renderer/head.php b/libraries/joomla/document/html/renderer/head.php index f0007ffd14860..e796647e39e53 100644 --- a/libraries/joomla/document/html/renderer/head.php +++ b/libraries/joomla/document/html/renderer/head.php @@ -219,6 +219,8 @@ public function fetchHead($document) // Generate script language declarations. if (count(JText::script())) { + JHtml::_('script', 'system/core.js', false, true); + $buffer .= $tab . '' . $lnEnd; } From d0709b039e2cfc249d2f4aa149f7f03f057192d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mo=C4=87ko?= Date: Tue, 29 Jul 2014 15:01:27 +0200 Subject: [PATCH 6/6] Update text.php Compatibility with Joomla 3.3 --- libraries/joomla/language/text.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 16e223a6c142b..851203c72efde 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -357,15 +357,7 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla self::$strings[strtoupper($string)] = JFactory::getLanguage()->_($string, $jsSafe, $interpretBackSlashes); // Load core.js dependence - - // Remove as soon as core.js is rewritten to jQuery - // https://github.com/joomla/joomla-cms/pull/2687 - // https://github.com/joomla/joomla-cms/pull/3047 - JHtml::_('behavior.framework'); - JHtml::_('script', 'system/core.js', false, true); - - /* Uncomment as soon as core.js is rewritten to jQuery - JHtml::_('behavior.core'); */ + JHtml::_('behavior.core'); } return self::$strings;