View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jan 20, 2011 7:43 pm Post subject: SmartyValidate 3.0 released |
|
|
This is basically SmartyValidate 2.9, but updated to be compatible with Smarty 3.0+. This version works only with 3.0 and up.
http://www.phpinsider.com/php/code/SmartyValidate/ |
|
Back to top |
|
robdawg Smarty Rookie
Joined: 15 Jul 2005 Posts: 13
|
Posted: Thu Feb 10, 2011 3:03 pm Post subject: |
|
|
Anyone having a problem with register_validator?
I have a file in the plugins directory named: validate_criteria.isValidForgotPassword.php
Inside that file, I have a function named: smarty_validate_criteria_isValidForgotPassword
I then call the register_validator function: SmartyValidate::register_validator('check_forgot_password', 'login_email', 'isValidForgotPassword', false, false, 'trim', 'ForgotPasswordForm');
Problem is, I get this error:
Notice: SmartyValidate: [is_valid] criteria function 'isValidForgotPassword' was not found. in C:\wamp\www\SITENAME.com\includes\Smarty3\SmartyValidate.class.php on line 588
Any ideas?
Thanks. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Feb 10, 2011 3:08 pm Post subject: |
|
|
make sure your plugin files are all lower-case. Smarty 3 this matters because of the autoloader. |
|
Back to top |
|
robdawg Smarty Rookie
Joined: 15 Jul 2005 Posts: 13
|
Posted: Thu Feb 10, 2011 3:25 pm Post subject: |
|
|
Great!
This worked but I also had to remove the "_" from the filename as well.
All good now, thanks again! |
|
Back to top |
|
conner_bw Smarty Rookie
Joined: 21 Dec 2007 Posts: 17
|
Posted: Thu Apr 21, 2011 3:15 am Post subject: |
|
|
Using 3.0.2-ish, found two minor bugs today:
1)
/plugins/function.validate.php
A bunch of $smarty->trigger_error, these are deprecated and should simply be trigger_error.
2)
In my app I was getting:
Notice: Undefined index: Date in libs/SmartyValidate.class.php on line 199
Line 199:
if(is_array($formvars[$_field]) && @is_array($formvars[$_field]) && !$_trans_on_array) {
Should be:
if(@is_array($formvars[$_field]) && !$_trans_on_array) {
Regards, |
|
Back to top |
|
techsterx Smarty n00b
Joined: 20 Aug 2011 Posts: 1
|
Posted: Sat Aug 20, 2011 3:12 am Post subject: |
|
|
I'm currently updating one of my sites to Smarty3 and ran into a couple issues with SmartyValidate. It seems the {$validate} variable along with the {validate} append attribute are no longer working. I checked all the docs and haven't noticed any changes with these.
Am I over looking something or could this something with my code? I created a plugin to handle this for my page, but everything else on there seems to be working alright and I'm not getting any more errors after making it compatible with Smarty3. |
|
Back to top |
|
robdawg Smarty Rookie
Joined: 15 Jul 2005 Posts: 13
|
Posted: Fri Sep 23, 2011 1:57 pm Post subject: |
|
|
Quick issue again, anyone having a problem with only the FIRST validator returning the error message?
I have 3 validators that append the error message to a variable and only the first error is getting set properly. The other 2 errors are are returning blank error messages.
Any ideas? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Sep 23, 2011 2:09 pm Post subject: |
|
|
post a working example (pastebin), I'll check it out |
|
Back to top |
|
robdawg Smarty Rookie
Joined: 15 Jul 2005 Posts: 13
|
|
Back to top |
|
robdawg Smarty Rookie
Joined: 15 Jul 2005 Posts: 13
|
Posted: Sat Sep 24, 2011 6:05 pm Post subject: |
|
|
I think I might of found a possible issue.
In file function.validate.php on line 144 you will find this:
$_sess['is_init'] = false;
The above line will get called on each validator, so anything after the first validator will not have the correct INIT flag.
Here is what is in the compiled template:
<?php echo smarty_function_validate(array('form'=>"ForgotPasswordChangePassword",'id'=>"check_forgot_password1",'message'=>"Must be a valid Password (6-16 Characters).",'append'=>"formErrors"),$_smarty_tpl);?>
<?php echo smarty_function_validate(array('form'=>"ForgotPasswordChangePassword",'id'=>"check_forgot_password2",'message'=>"Passwords do not Match.",'append'=>"formErrors"),$_smarty_tpl);?>
As you can see it is getting called twice but the second call will have an INIT flag of FALSE and not set the proper variables.
No solution yet, let me know if you see something.
Thanks. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Sep 26, 2011 2:41 pm Post subject: |
|
|
I think I found it, here is the new function.validate.php plugin:
[removed, see next message below]
let me know if that works.
Last edited by mohrt on Mon Sep 26, 2011 3:08 pm; edited 1 time in total |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
Crazyman Smarty n00b
Joined: 29 Dec 2011 Posts: 1
|
Posted: Thu Dec 29, 2011 9:56 am Post subject: |
|
|
Thanks for updates! |
|
Back to top |
|
mmopin22 Smarty n00b
Joined: 30 May 2013 Posts: 1
|
Posted: Thu May 30, 2013 9:00 am Post subject: |
|
|
The world has transformed from the traditional era of conducting business. In this modern day, online business has grown to be very popular. This online business usually involves virtual goods. These are goods that, though not physical, are owned and their value is tangible to the owner. It is these virtual goods that are the main items of trade in online business. In this context, the effect of FIFA 13 coins in the world of FIFA online gaming is immense and worth the irrefutable repute they have gained.
------------------------------
gw2 gold|wow gold|rs gold |
|
Back to top |
|
|