? Success

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
30 Nov 2014

This prevents error if core.js is not loaded by defining the Joomla namespace

Solves #5258

avatar dgt41 dgt41 - open - 30 Nov 2014
avatar jissues-bot jissues-bot - change - 30 Nov 2014
Labels Added: ?
avatar dgt41
dgt41 - comment - 30 Nov 2014

To test go to Banners -> Tracks and press the button export
screen shot 2014-11-30 at 4 11 50

Apply the patch and retest!

avatar Bakual
Bakual - comment - 30 Nov 2014

How about you just load core.js where the namespace is defined?

I think it's a bit strange when we start defining the same namespace in various places.
We should either load core.js or use a different/own/no namespace for the methods in the Isis template

avatar dgt41
dgt41 - comment - 30 Nov 2014

@Bakual The question here is: do we really need to define the function as Joomla.tooggleSidebar ?
A function toggleSidebar I think is unique enough...

avatar phproberto
phproberto - comment - 30 Nov 2014

The Joomla.toggleSidebar function has been removed in the latest sidebar PR.

avatar dgt41
dgt41 - comment - 30 Nov 2014

@phproberto I am afraid it is still there! The problem is that right now is not in core.js but is also dependent on core.js, which is not optimal. Take a look here:
https://github.com/joomla/joomla-cms/blob/staging/administrator/templates/isis/js/template.js#L60

avatar dgt41
dgt41 - comment - 30 Nov 2014

@phproberto The problem is that whenever a bootstrap modal is rendered an error:
ReferenceError: Can't find variable: Joomla is getting logged

screen shot 2014-11-30 at 3 41 36

avatar Fedik
Fedik - comment - 30 Nov 2014

@phproberto it was just moved from core.js to template.js :wink:

avatar Bakual
Bakual - comment - 30 Nov 2014

The question here is: do we really need to define the function as Joomla.tooggleSidebar ?
A function toggleSidebar I think is unique enough...

Imho, it's better without the Joomla namespace because it's template specific :smile:

avatar infograf768
infograf768 - comment - 1 Dec 2014

@test
works here.

avatar brianteeman brianteeman - alter_testresult - 1 Dec 2014 - infograf768: Tested successfully
avatar zero-24 zero-24 - change - 1 Dec 2014
Category JavaScript
avatar dgt41
dgt41 - comment - 2 Dec 2014

@JoomliC can you test this one?

avatar JoomliC
JoomliC - comment - 2 Dec 2014

@dgt41 yes i can, but it could be better in think to change Joomla.toggleSidebar into JtoggleSidebar, so that, no undefined namespace as @Bakual suggested :

use a different/own/no namespace for the methods in the Isis template

The Joomla.toggleSidebar function has been removed in the latest sidebar PR.

@phproberto i thought core.js was always loaded in backend... so i've not changed it. But we can!

@dgt41 better to open a new PR to fix namespace by changing Joomla.toggleSidebar in JtoggleSidebar ?

avatar dgt41
dgt41 - comment - 2 Dec 2014

@JoomliC Hehe I already did this, take a look at https://github.com/joomla/joomla-cms/pull/5259/files

avatar JoomliC
JoomliC - comment - 2 Dec 2014

@dgt41 Yes sorry! A little headache this morning, need more coffee !!!

@test success ! Tested with Isis, and a third-party admin template, all is ok! :+1:

Well done Dimitris!

avatar dgt41
dgt41 - comment - 2 Dec 2014

@JoomliC Yes, thats the weird thing core.js is called in layouts/joomla/sidebars/submenu.php but for an unknown to me reason the modals throw an error. core.js will still be needed for the strings translations, so all that this is doing is removing the strange javascript error whenever a modal is fired!

avatar waader
waader - comment - 11 Dec 2014

@test works!

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

avatar waader waader - test_item - 11 Dec 2014 - Tested successfully
avatar smanzi smanzi - test_item - 13 Dec 2014 - Tested successfully
avatar roland-d roland-d - close - 14 Dec 2014
avatar roland-d roland-d - change - 14 Dec 2014
Title
Make sure that Joomla namespace is defined otherwise define it!
Remove Joomla namespace from sidebar script
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-12-14 15:07:03

Add a Comment

Login with GitHub to post a comment