So, I now script-generated 100 users and tested with those. And I can confirm that it takes very long to generate the options list when using checkboxes, although the system does not hang itself up. The result is way faster with select or radio fields. While I doubt that such a long list of options really makes sense, this is still weird.
I recall there was an issue on GitHub regarding checkboxes and JSON API queries, but that was fixed in June. And when using the JSON API now, the options are created fast, at least after the second load.
I also tested the above user example without a named key and it way a lot faster.
Gives this result. Also notice it combines any simular $keys but also counts the array then loops through that many times. + 1.
Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green ) Array ( [green] => blue [tan] => green )
It was to verify that it’s counting. But yeah, we don’t have duplicate keys. I just wanted to see if it ignores it or counts it, which I’m pretty sure it’s counting it.
Update. Or it’s not
$array = array(‘green’ => ‘blue’, ‘tan’=> ‘red’, ‘pink’ => ‘green’,); This returns the array below. Which is 10 so it’s 3 times the loop plus one.
Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green ) Array ( [green] => blue [tan] => red [pink] => green )
Just tested
$array = array(‘green’ => ‘blue’);
Array ( [green] => blue ) Array ( [green] => blue ) Array ( [green] => blue ) Array ( [green] => blue )
That’s what I was just going to ask, have you tested this with a nice, fresh Starterkit yet? I haven’t tested with 2.5.6 yet, but I don’t think there have been any changes from 2.5.6 to 2.5.7 that could be causing this behavior.
Edit: As expected, 2.5.6 gives me the same results.
They are internal company permissions. The permissions have ID’s but dev is saying the permissions are all stored by name, because that is the practice for those permissions. So if I ever reference them, they have to be by name. I wish I could and there weren’t that many. Not my decision though. lol.