? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
11 Jun 2018

Pull Request for Issue #20719

Summary of Changes

Make JHtml::_('behavior.core'); also load language strings used by core.js

		JText::script('ERROR');
		JText::script('INFO');
		JText::script('NOTICE');
		JText::script('MESSAGE');
		JText::script('WARNING');

Testing Instructions

A backend message should show as title
Success instead of success
Warning instead of warning

notice the capital letter to know that translation is working

Expected result

Actual result

Documentation Changes Required

avatar ggppdk ggppdk - open - 11 Jun 2018
avatar ggppdk ggppdk - change - 11 Jun 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jun 2018
Category Libraries
avatar ggppdk ggppdk - change - 11 Jun 2018
Title
Load language string for message titles used by core.js
[4.0] Load language strings for message titles used by core.js
avatar ggppdk ggppdk - edited - 11 Jun 2018
avatar brianteeman brianteeman - test_item - 11 Jun 2018 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 11 Jun 2018

I have tested this item ? unsuccessfully on 49ef2cd

Did you test this? I get a fatal error as soon as it is applied


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

avatar ggppdk
ggppdk - comment - 11 Jun 2018

Did you test this?

No,
i was interrupted by a small kid,
was going to do it as soon as i returned

I get a fatal error as soon as it is applied

The reason that this does not work is because of an infinite call loop between:

JText::script('...');
HTMLHelper::_('behavior.core'); 
avatar ggppdk ggppdk - change - 11 Jun 2018
Labels Added: ?
avatar ggppdk ggppdk - change - 11 Jun 2018
The description was changed
avatar ggppdk ggppdk - edited - 11 Jun 2018
avatar ggppdk
ggppdk - comment - 11 Jun 2018

Infinite loop broken,
but i do not like adding 1 more parameter to the signature of method JText:script()
any better suggestions are welcome

avatar HLeithner
HLeithner - comment - 12 Jun 2018

Instead of creating a new parameter you may use a static variable to check if HTMLHelper::_('behavior.core'); already get called in the script function

avatar ggppdk
ggppdk - comment - 13 Jun 2018

Instead of creating a new parameter you may use a static variable to check if HTMLHelper::_('behavior.core'); already get called in the script function

Thanks, an extra note
the above is guaranteed to work only if you place the change of the variable to true, before any call to HTMLHelper::_('behavior.core');
otherwise you will still get a loop if the first call to JText::script() is made by HTMLHelper::_('behavior.core'); itself

avatar ggppdk ggppdk - change - 13 Jun 2018
The description was changed
avatar ggppdk ggppdk - edited - 13 Jun 2018
avatar ggppdk ggppdk - change - 13 Jun 2018
The description was changed
avatar ggppdk ggppdk - edited - 13 Jun 2018
avatar ggppdk
ggppdk - comment - 16 Jul 2018

Thanks anyone spending time on this PR
No interest in spending more on it by me

avatar ggppdk ggppdk - change - 16 Jul 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-07-16 05:38:54
Closed_By ggppdk
avatar ggppdk ggppdk - close - 16 Jul 2018

Add a Comment

Login with GitHub to post a comment