[#30274] JFormValidator JavaScript class does not scale well#798
[#30274] JFormValidator JavaScript class does not scale well#798rmcdaniel wants to merge 1 commit intojoomla:masterfrom
Conversation
|
Testing went well. Any idea on if/when this will be accepted? |
|
We have two confirmed tests now. The patch works. |
There was a problem hiding this comment.
I think we should do precomputation of label-fields in attachToForm function because if we do it in isValid every time https://github.com/rmcdaniel/joomla-cms/blob/d2c5e2c27f403bb3629ff4f4c76c53e1b1dd75b3/media/system/js/validate-uncompressed.js#L79 called we compute the same labels again and again.
I did it in https://github.com/Achal-Aggarwal/joomla-cms/compare/jquery-validation
There was a problem hiding this comment.
If we are going to move it anywhere, we should do as piotr-cz suggested and move it to initialize.
There was a problem hiding this comment.
both initialize and attachToForm are called once as initialize call attach to form for each form once. Even we can do the label computation in https://github.com/rmcdaniel/joomla-cms/blob/d2c5e2c27f403bb3629ff4f4c76c53e1b1dd75b3/media/system/js/validate-uncompressed.js#L72 also.
There was a problem hiding this comment.
There may be more than one form on a page and therefore attachToForm may be called multiple times.
|
What is the current status of this PR? I does need to be updated with |
|
I was under the impression that pull requests before a certain date didn't have to be resubmitted to staging. |
|
Yes, you are right, it does not need to be resubmitted against staging, but it is no longer in synch. It needs to be updated with the latest changes so it can be merged. |
|
It looks like I'll have to resubmit the pull request anyways because this needs to go in 2.5.x not master. |
|
Yes, you are correct. My apologies for not noticing that. I'm going to close this issue then. |
Joomla!'s JFormValidator JavaScript class does not scale well with large numbers
of form elements. The reason for this is that the handleResponse() method loops
through every label each time it is called. Instead of this, I have modified
the code to do this only once and store the results for future use.
Here is the relevant forum post:
http://forum.joomla.org/viewtopic.php?p=3002410#p3002410
Here is the issue tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=30274