?
avatar eraumavez
eraumavez
1 Oct 2014

Steps to reproduce the issue

• Create multiple menus (more 100)
• Go to System | Global Configuration

Expected result

The global configuration page freeze and there will be a debug warning:

  • media/jui/js/jquery.min.js:2 (script doesn’t respond)
  • Empty string passed to getElementById()
  • Use of getAttributeNode() is deprecated. Use getAttribute() instead.

Actual result

System information (as much as possible)

PHP 5.3.29 - Joomla 3.3.6
Firefox, Internet Explorer and Chrome

Additional comments

avatar eraumavez eraumavez - open - 1 Oct 2014
avatar Fedik
Fedik - comment - 1 Oct 2014

chosen.js :smirk:

I not very understand how the menu related to System global configuration, but after watching the video, maybe you mean access levels?

it problem of chosen.js initialisation, it take a lot time because you have a loot <select> for View levels

Please try next test, make empty file chosen.jquery.min.js and put in to /administrator/templates/isis/js/jui/chosen.jquery.min.js

In theory you can use it as temporary solution, but be aware, this can break a tag selection in the article.

avatar eraumavez
eraumavez - comment - 1 Oct 2014

Hello Fedik, thanks for your replay and comments.

In my tests deleting Groups Access gave better performance to global configuration page. But after your replay I made the same test but using Access Level, and I have the same results.

I don’t understand how the number of records in the Group Access table or Access Level table records can freeze Global Configuration page.
In order to solve this issue, I have done your suggestion but didn’t solve this problem.

Joomla 3 can handle with 220 groups and 220 access levels?

For those you think this is too much (220), I will give my situation and please comment if there is a better way to do this.
A company have 50 departments; each department can create, edit and publish only their articles (category). So 50 departments * 3 (author, editor, publisher) = 150; And this situation can be worse if the site have 3 language and the author of English articles, doesn’t have access to Portuguese or French pages.
Joomla, should handle with this. I don’t know what I did wrong. Any suggestion.

Fedik, returning to you, do you have any other suggestion, if you want I can give you privileges (super administrator) to do same test. Thanks in advance.

Thanks

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

avatar Fedik
Fedik - comment - 2 Oct 2014

I never used so much access levels, but yes I think Joomla! can handle it.

This performance problem related to the styling,
script that used for style a <select> (drop down) tag is very slow when on the page you have a lot such tags.
It old bug, and I have a doubt that it will be fixed in near future for Joomla! 3.

Strange that trick with empty file do not help, maybe try put in this file some text,
something like: /* this is empty file */
and please make sure that you have a right path to the file /administrator/templates/isis/js/jui/chosen.jquery.min.js.
This should override the slow script, and disable additional styling for <select> ... I tried on my test installation and there it works.

if you have a debug enabled, then you need use different file name /administrator/templates/isis/js/jui/chosen.jquery.js.

avatar brianteeman
brianteeman - comment - 2 Oct 2014

Just a wild thought - I have had issues when you have lots of menus or modules and this might help


Every time you save a module it saves the menu assignment for that module. If you have over 1000 menu items so each time it saves a module it will save 1000 variables (eg menu item 1 ON, menu item 2 OFF etc)

php has a default limit of 1000 variables on a form submission so the form may be failing because you have reached that maximum and your php error log will show that.

As this is a server task the BEST way to do this can vary between server setups so it's best that you speak to the hosts about the exact way that is best on their servers.

What you want to ask them to do is to increase max_input_vars from the default value of 1000 to something like 3000.

This is the correct code for that
max_input_vars = 3000

But if the host is running suhosin they may need to ALSO add

suhosin.post.max_vars = 3000
suhosin.request.max_vars = 3000
_

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

avatar eraumavez
eraumavez - comment - 2 Oct 2014

Fedik,
I create a new directory (jui) in the /administrator/templates/isis/js/, then upload the file with /* this is empty file */ and didn’t solve the problem.
It’s necessary to create the jui directory?

Thanks for your comments

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

avatar Fedik
Fedik - comment - 2 Oct 2014

It’s necessary to create the jui directory

yes,

didn’t solve the problem

strange, please check the source code of the page in browser (Ctrl + U usually),
before changes:
screen 2014-10-02 12 48 33 735x27
and after changes, should be something like next:
screen 2014-10-02 12 49 53 735x27

avatar eraumavez
eraumavez - comment - 2 Oct 2014

brianteeman,

I understand your point of view, but I opening the Global Configuration, not saving.

My database have: 2227 associations (com_menus); 1098 assets; 199 categories; 391 articles; 1805 menus; 160 menus types; 460 modules; 6038 modules menu; 1 user; 213 usergroups; 209 Access level.
PHP Version 5.3.29; max_execution_time 60; max_input_time 120; max_input_vars 8000; memory_limit 256M
I understand your point of view, but I openning

Why error in jquery.min.js:2 (script doesn’t respond)?

Thanks for your support.

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

avatar eraumavez
eraumavez - comment - 2 Oct 2014

I checked the source code, and is there

screen shot 2014-10-02 at 05 06 23

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

avatar Fedik
Fedik - comment - 2 Oct 2014

and you still have a freeze? or maybe something changes?

avatar eraumavez
eraumavez - comment - 2 Oct 2014

Still freeze,
My source code of that page (Global Configuration) have 1864 kb.

The difference is amazing (170 kb – regular file vs 1864 kb),

avatar Fedik
Fedik - comment - 2 Oct 2014

ok, here is next idea, try use this code for 'empty file', that you made before:

(function($){
    // chosen.js gag
    $.fn.chosen = function(){
        // do nothing
        return this.each(function() {
            $(this).data('chosen', {});
        });
    }
    // tooltips.js gag
    $.fn.tooltip = function(){
        // do nothing
        return this;
    }
})(jQuery);

and please tell me result, whether there still same freeze with jquery.min.js:2 (script doesn’t respond) error

avatar eraumavez
eraumavez - comment - 2 Oct 2014

Sorry Fedik, didn't work, the jquery.min.js freeze in 2 line.

Thanks for your support.

avatar eraumavez eraumavez - close - 2 Oct 2014
avatar zero-24 zero-24 - close - 2 Oct 2014
avatar eraumavez eraumavez - change - 2 Oct 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-10-02 15:01:57
avatar Fedik
Fedik - comment - 2 Oct 2014

wait, last try :smile:
I just finished some tests, and need someone who can confirm, whether it really help :wink:
please try test #4435 'optimize validation.js performance'

if you not friend with git, then just download and replace original files:
validate-uncompressed.js
validate.js

avatar eraumavez
eraumavez - comment - 2 Oct 2014

Fedik, first thanks for your assistance.

I can’t repeat your tests, did you use an extension to do that charts or a special chrome feature?

Anyway, I did overwrite those files, and my Global Configuration loads very fast, but I get an error message when save or cancel.

90% of problem is solved!
Please check the video http://videobam.com/VwVpy
Thanks

avatar Fedik
Fedik - comment - 2 Oct 2014

charts it by Chrome, but no need make a chart :wink:

here is another try:
validate-uncompressed.js
validate.js

avatar ggppdk
ggppdk - comment - 3 Oct 2014

About chosen lib, it is also a JS performance problem, even with latest improvements
Long ago, we have disabled chosen lib in our configuration forms

$jinput = JFactory::getApplication()->input;
$option = $jinput->get('option', '', 'string');
$view = $jinput->get('view', '', 'string');
$controller = $jinput->get('controller', '', 'string');
$component = $jinput->get('component', '', 'string');

if (
$option=='com_config' &&
($view == 'component' || $controller='component') &&
$component == 'com_MYCOMPONENTNAME'
) {
// Make sure chosen JS file is loaded before code that disables it
JHtml::('formbehavior.chosen', '#_some_iidd');

// replace chosen function
$js .= "\n jQuery.fn.chosen = function(){}; \n";
}
if ( !empty($js) ) $JFactory->getDocument()->addScriptDeclaration($js);

avatar eraumavez
eraumavez - comment - 3 Oct 2014

Fedik,

I have done 20 tests, in 80% of those there isn’t any problem but in some cases, after pressing Save; Save & Close or Close the jquery.min.js:2 freezes.
Question:
With this solution, do I need to have the empty file (chosen.jquery.min.js) and the jui directory (/administrator/templates/isis/js/jui/).
Thanks for your time

avatar eraumavez
eraumavez - comment - 3 Oct 2014

Ggppdk,

Thanks for your comment, could you please explain how to do that?
Your idea is to edit / create a chosen.jquery.js file and insert your code into?

Thanks

avatar Fedik
Fedik - comment - 3 Oct 2014

With this solution, do I need to have the empty file (chosen.jquery.min.js)

yes, but of course, you can play with it add/remove ...
ggppdk suggested same as we did with "empty file", but in different way :smile:

as I understand main problem caused by validation.js ..
so, last thing that I can suggest you:

  • take validate-uncompressed.js
  • rename it to validate.js and save in /administrator/templates/isis/js/system/.. (this prevet reseting on Joomla! upgrade, in theory)
  • then edit it a bit, find:
handleResponse = function(state, $el) {
        // Get a label
        var $label = $el.data('label');
        if($label === undefined){
            $label = findLabel($el.attr('id'), $el.data('form'));
            $el.data('label', $label);
        }

and change to:

handleResponse = function(state, $el) {
        // Get a label
        var $label = $el.data('label');
avatar eraumavez
eraumavez - comment - 4 Oct 2014

Apparently there aren’t problems with it
I will post the solution, for others users who are dealing with the same issue.

  1. Create a file with the name chosen.jquery.min.js, and insert this code:
(function($){
  // chosen.js gag
    $.fn.chosen = function(){
        // do nothing
        return this.each(function() {
            $(this).data('chosen', {});
        });
    }
    // tooltips.js gag
    $.fn.tooltip = function(){
        // do nothing
        return this;
    }
}
  1. Create a new directory in /administrator/templates/isis/js/jui/
  2. Move the new file to this directory, with the final goal (/administrator/templates/isis/js/jui/chosen.jquery.min.js)

  3. Move media/system/js/validate-uncompressed.js and rename it to administrator/templates/isis/js/validate.jsvalidate.js or Copy and Rename

  4. Edit the code and change
handleResponse = function(state, $el) {
        // Get a label
        var $label = $el.data('label');
        if($label === undefined){
            $label = findLabel($el.attr('id'), $el.data('form'));
            $el.data('label', $label);
        }

to:

handleResponse = function(state, $el) {
        // Get a label
        var $label = $el.data('label');
}
  1. Enjoy better performance

All credits for Fedik

avatar eraumavez
eraumavez - comment - 4 Oct 2014

ggppdk,

I would like to test your solution, could you please share your thoughts with us.
How to do that ....

Thanks

avatar ggppdk
ggppdk - comment - 4 Oct 2014

The code i suggested, does not involve changing or hacking the
chosen.jquery.min.js

  • it disables chosen JS lib only on selected pages (views),

you can add the code in any of your PHP file that gets loaded in the desired view

we added it to a JForm parameter element file:
e.g.
administrator/component/com_NAME/elements/myparameter.php

which is a file that get loaded in the views that we wish to disable, e.g. in component configuration


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

avatar Fedik
Fedik - comment - 4 Oct 2014

@eraumavez a bit different, maybe I made bad example :smile:

the final method in validate.js should looks like next:

handleResponse = function(state, $el) {
    // Get a label
    var $label = $el.data('label');

    // Set the element and its label (if exists) invalid state
    if (state === false) {
        $el.addClass('invalid').attr('aria-invalid', 'true');
        if($label){
            $label.addClass('invalid').attr('aria-invalid', 'true');
        }
    } else {
        $el.removeClass('invalid').attr('aria-invalid', 'false');
        if($label){
            $label.removeClass('invalid').attr('aria-invalid', 'false');
        }
    }
 }

or more clean up:

handleResponse = function(state, $el) {
    // Set the element and its label (if exists) invalid state
    if (state === false) {
        $el.addClass('invalid').attr('aria-invalid', 'true');
    } else {
        $el.removeClass('invalid').attr('aria-invalid', 'false');
    }
 }

but not more, cause it add/remove invalid class to the input, for display what field has a validation problem.

avatar zero-24 zero-24 - change - 7 Jul 2015
Title
Global configuration freeze with several menus
Global configuration freeze with several menus
Labels Added: ?

Add a Comment

Login with GitHub to post a comment