Great Module, Just what I was looking for.

I am noticing performance issues though.

The admin/user/user/create page is very slow to load.

Also, the radio button for account types on this page causes Firefox to freeze.
I have two 'account types' basic [as provided] and annual.
When I select 'annual' in this radio button option group, the whole page freezes.
Eventually the allowed roles are then made available to select.

I'm guessing this is some sort of javascript issue, but I'm not sure.

Regards
Alan

Update: I'm running the Jquery update module, and its related to this
I'll try to get to the bottom of this.

Comments

alanburke’s picture

Ok I don't think its related to that Jquery update module
[I removed it, went back to standard Drupal 5 jquery, and there were still issues]

It doesn't even seem to be javascript related.
The browser [latest Firefox] juts hangs for an age, on the last HTTP request [that's originally why I thought it was javascript].

Continuing to investigate.
Maybe its a form builder thing?

Later
Alan

alanburke’s picture

Project: Account Expiry » Account Types

Ok its is Javascript related.
Disable Javascript, and it flies along.
Its the module account types, not account expiry [which has accounttypes as a prerequisite]

Regards
Alan

alanburke’s picture

Version: 5.x-1.x-dev » 5.x-1.4
rconstantine’s picture

Category: bug » support

Hmm. Do you get different behavior on the user edit page (ex. user/22/edit)? It should behave the same as the create page I think. Anyway, in my installations, there is maybe a half second delay with 20-30 roles defined and 5-6 accounttypes. Have you tried accounttypes without account_expiry? Both my create and edit pages are fine.

Yes the delay is JavaScript. However, the functions have all been cleverly slimmed as small as they will go using regular JavaScript. I'm sure some advantage could be had changing it to JQuery, but I haven't done it yet. However, the time it is taking you seems inordinately long.

Until we can pinpoint a bug, I'm guessing account_expiry may be doing something here, so I'm changing this to support for now.

alanburke’s picture

Thanks for the response,
I've tried it without account_expiry, and without node Profile [which is also installed].

It's definitely the javascript.

I only have two account types, and 4 roles, so i'm a bit confused as to why it's so slow.
I'll try it an a few different browsers, and see what the outcome is.

Thanks and Regards
Alan

rconstantine’s picture

Take a look at the page source since all of the JavaScript should be there. Maybe paste it here so I can make sure it's OK.

alanburke’s picture

Hi rconstantine,

Thanks for looking into this.

I did futher testing in IE, and Opera, and no issues there.
It is only in Firefox 2.0.0.8

Now, I should be honest and admit that I do have a good few plugins installed, including firebug.
I occassionally have issues with this browser [slowdowns], but nothing quite this bad.

Here is the js code generated in any case.

        function radioclick2() {
          var nor = { "2": { "5": 5, "2": 2, "4": 4, "3": 3 } };
          var yesr = { "2": { "4": "4" } };
          var initr = { "2": { "4": 4 } };
          for (var y in nor[2]) {
            $("#user-register :checkbox[@id=edit-roles-"+ y +"]").removeAttr("checked");
            $("#user-register :checkbox[@id=edit-roles-"+ y +"]").attr("disabled", "disabled");
          }
          for (var b in yesr[2]) {
            $("#user-register :checkbox[@id=edit-roles-"+ b +"]").removeAttr("disabled");
          }
          for (var za in initr[2]) {
            $("#user-register :checkbox[@id=edit-roles-"+ za +"]").attr("checked", "checked");
          }
        }
        function radioclick1() {
          var nor = { "1": { "5": 5, "2": 2, "4": 4, "3": 3 } };
          var yesr = { "1": { "2": "2" } };
          var initr = { "1": [  ] };
          for (var y in nor[1]) {
            $("#user-register :checkbox[@id=edit-roles-"+ y +"]").removeAttr("checked");
            $("#user-register :checkbox[@id=edit-roles-"+ y +"]").attr("disabled", "disabled");
          }
          for (var b in yesr[1]) {
            $("#user-register :checkbox[@id=edit-roles-"+ b +"]").removeAttr("disabled");
          }
          for (var za in initr[1]) {
            $("#user-register :checkbox[@id=edit-roles-"+ za +"]").attr("checked", "checked");
          }
        }
        $(document).ready(function() {
          radioclick1();$("#user-register :radio[@name=selectAT][@value=2]").click(function(){radioclick2();});$("#user-register :radio[@name=selectAT][@value=1]").click(function(){radioclick1();});});</script>

If it looks alright to you, mark this as fixed.

Regards
Alan

alanburke’s picture

I did a further check, with Firefox in Safe mode, and all was well.
It must be some plug-in I have installed [perhaps Firebug]

Regards
Alan

rconstantine’s picture

I have Firebug installed as well (as any good developer would) and still, mine updates in a fraction of a second.

I also have about a dozen other addons installed and working. However, try disabling (not uninstalling) yours one at a time and see if you get any improvement. Also, update Firefox - it's at 2.0.0.12 now I believe.

As you can see by the code generated, it's pretty small and doesn't try to do anything crazy. There aren't loops that run more than four times (in your case), so it really should be fast for you.

rconstantine’s picture

Status: Active » Fixed

If I don't hear more, I'll just have to close this. Marking fixed so it will timeout in two weeks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.