Form validation is too slow.

302 views
Skip to first unread message

Impression eStudio

unread,
Feb 16, 2012, 4:27:34 PM2/16/12
to joomla-de...@googlegroups.com
Hi all,

I created a plugin with many parameters and when I click "Save" the page almost crashes because the following scripts take too long time.

media/system/js/mootools-core.js
media/system/js/validate.js

I have tested it in many browsers, in localhost and in a real server. 
Maybe in Joomla 1.5 you can accept the delay but in Joomla 1.6, 1.7 and 2.5 is unacceptable.

Does anyone know how to disable the validation or make it faster?

Thanks

YKHC Xtreme

unread,
Feb 16, 2012, 5:29:49 PM2/16/12
to joomla-de...@googlegroups.com
dont use your js libraries hosted , use the google one so fast & never never host them in your webserver & use them they will take so long to load,

like that

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript" ></script>
& this is the link for mootool
& i think mootoool is fast than jquery & is the best
.....

Rouven Weßling

unread,
Feb 16, 2012, 5:45:47 PM2/16/12
to joomla-de...@googlegroups.com
What browser are you using? Just how big are the setting?



His issue isn't with loading but execution time.

Impression eStudio

unread,
Feb 17, 2012, 4:53:22 AM2/17/12
to joomla-de...@googlegroups.com
The problem using the library of Google is that other users of the plugin maybe be not capable to do that change.
The parameters are taken, as you already may know, from the xml file, so I can't add any code in there.

The number of the parameters are around 800!!! 
I am using mostly Chrome but I checked it also in Firefox. The same delay.

Thank you for your concern. 

Mike Smith

unread,
Feb 17, 2012, 5:21:07 AM2/17/12
to joomla-de...@googlegroups.com
Then the problem is more likely your host server hitting a limit.

> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/eOiIuJv3D2wJ.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Hannes Papenberg

unread,
Feb 17, 2012, 5:34:51 AM2/17/12
to joomla-de...@googlegroups.com

Since he is talking about a Javascript script, which is provided by Joomla and exclusively runs on your client PC in the browser, without connection to the server and without any loading issues from the server (the script is already loaded a long time ago and is also just a few kb in size), none of the answers so far are really helpfull.

However, I don't have a solution for you either. Using 800 parameters is A LOT. I'm not sure if there really is a good solution... More than 30 parameters are already a lot simply in terms of usability...

From my perspective you have two possibilities: You can try to improve the validation script or you can remove the logic from the script and always make it return true. Unless you drastically reduce the number of parameters.

ms

unread,
Feb 17, 2012, 5:49:25 AM2/17/12
to joomla-de...@googlegroups.com
With all due respect, at some point his form is trying to SAVE the content, this has to be sent back to the server, and I suspect the server handling limit is being reached not the form validation process itself, which is quite simple.

And 800 parameters is way, way too large especially when you don't know the field size of each element and what the total data size being managed is.

Impression eStudio

unread,
Feb 17, 2012, 8:15:57 AM2/17/12
to joomla-de...@googlegroups.com
I am back with good news this time!

I tried other ideas (like the idea of Ucefkh) but the idea of Hannes Papenberg worked fine.

The solution was to add code so the validation script returns always true. Of course this happens only in my plugin, not in whole Joomla.
Specifically, I created a custom param in the plugin and in the php file of it I added the following code:

<?php
class JFormFieldFix extends JFormField 
{
protected $type = 'Fix';
protected function getInput()
{
$output .= '<script type="text/javascript">
window.addEvent("domready", function() 
{
// Special fix for Joomla 1.6, 1.7 & 2.5.
document.formvalidator.isValid = function() {return true;};
})
</script>';

return $output;
}
}
?>

Now when I save the plugin it works fine.

I want to mention the following. The delay in the validation script is something that happened mainly in Joomla 1.6, 1.7 and 2.5. The delay in Joomla 1.5 was acceptable for all these parameters. So I want to say that, in general, Joomla 1.6, 1.7 and 2.5 have slow administration. Especially the "Manage" page of "Extension Manager". I think this is something that must be improved.

Thanks for the help.
If someone needs more info, just contact me.

Rouven Weßling

unread,
Feb 21, 2012, 4:38:16 PM2/21/12
to joomla-de...@googlegroups.com
Is the plug-in with 800 params publicly available? I'd love to do some profiling on our validator with it.

Best regards
Rouven

Impression eStudio

unread,
Feb 22, 2012, 2:46:27 AM2/22/12
to joomla-de...@googlegroups.com
Hi Rouven,

The plugin, called "Complete Image Styles", is pending approval in JED. I guess as a developer of Joomla you will have access to that.
Reply all
Reply to author
Forward
0 new messages