View previous topic :: View next topic |
Author |
Message |
cyberguy Smarty n00b
Joined: 06 Jan 2011 Posts: 1
|
Posted: Thu Jan 06, 2011 12:09 pm Post subject: Re: Fails with 3.0 rc1 - rc3 |
|
|
mohrt wrote: | cycler wrote: | This plugin seems very nice! However for 3.0 compatibility it appears it needs some maintainance.
After it failed with 3.0 i tried it with 2.6.25 and it works perfectly.
I first tested the example with rc3 and i get a deprecated notices for each form field. When submitting anyway i get a fatal error. I've included the full errors below.
Any help would be appreciated I understand that solving this will not be trivial
--
i get multiple of these for the form displaying part
Notice: function call 'get_template_vars' is unknown or deprecated. in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 57
--
i get this when submitting
Notice: function call '_get_plugin_filepath' is unknown or deprecated. in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 57
Fatal error: Uncaught exception 'Exception' with message 'unknown method '_get_plugin_filepath'' in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php:117 Stack trace: #0 C:\xampp\xampp\htdocs\_smartytest2-3\libs\Smarty.class.php(763): Smarty_Internal_Wrapper->convert('_get_plugin_fil...', Array) #1 [internal function]: Smarty->__call('_get_plugin_fil...', Array) #2 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(490): Smarty->_get_plugin_filepath('validate_transf...', 'trim') #3 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(199): SmartyValidate::_execute_transform('trim', '', Array, Array, 'default') #4 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(285): SmartyValidate::_failed_fields(Array, 'default') #5 C:\xampp\xampp\htdocs\_smartytest2-3\validate\index.php(33): SmartyValidate::is_valid(Array) #6 {main} thrown in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 117 |
It needs updated for 3.0. I'll do that after 3.0 is finalized. Basically get_template_vars needs to be getTemplateVars, and _get_plugin_filepath is being used to load plugins, it needs to use loadPlugin() instead. |
I am using Smarty 3+ and renamed get_template_vars to getTemplateVars and _get_plugin_filepath to loadPlugin() but i still get the same kind of error.
Can i use this plugin using 3+ smarty or not ? thank you.
[edit]
This is the error returned:
Fatal error: Uncaught exception 'SmartyException' with message 'plugin validate_criteria is not a valid name format' |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
conner_bw Smarty Rookie
Joined: 21 Dec 2007 Posts: 17
|
Posted: Wed Feb 16, 2011 7:19 pm Post subject: |
|
|
Hi, I'm trying to update my web app to Smarty 3. It relies heavily on SmartyValidate.
I'm getting dozens of the following errors:
Strict Standards: Non-static method SmartyValidate::register_object() should not be called statically, assuming $this from incompatible context
Mind you, this is because i have E_STRICT when I develop, but this begs the question, if Smarty 3 doesn't throw any of these because it's been upgraded to follow contemporary PHP standards, then why should Smarty Validate?
Is the class still static? Or do the docs need updating? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Feb 16, 2011 9:21 pm Post subject: |
|
|
Yes that looks like a problem. 3.0.1 is released with the E_STRICT warnings fixed, and the constructor updated for PHP5. |
|
Back to top |
|
conner_bw Smarty Rookie
Joined: 21 Dec 2007 Posts: 17
|
Posted: Wed Feb 16, 2011 11:57 pm Post subject: |
|
|
mohrt wrote: | Yes that looks like a problem. 3.0.1 is released with the E_STRICT warnings fixed, and the constructor updated for PHP5. |
Terrific, thanks! |
|
Back to top |
|
asmar Smarty n00b
Joined: 26 Oct 2008 Posts: 4
|
Posted: Mon Jun 13, 2011 3:02 pm Post subject: Special character check |
|
|
Hi all,
I'm a little bit confused about this plugin usage and will appreciate any help.
I have a text field where special characters like Code: | @ # % & * _ + \ ' ? , . | must not be entered into the form prior to form submission (as user types any of them).
Can that be done somehow with this plugin?
Thanks |
|
Back to top |
|
kstingel Smarty n00b
Joined: 22 Feb 2012 Posts: 2
|
Posted: Tue Feb 28, 2012 7:12 pm Post subject: Extended Installation and SmartyValidate |
|
|
following the pattern in the Extended setup, I have created my own class extending Smarty ... I then use this class across all my sites.
Code: | // smarty configuration
class <myApp>_Smarty extends Smarty
{
function __construct()
{
parent::__construct();
$this->setTemplateDir('smarty/templates/');
$this->setCompileDir('smarty/templates_c/');
$this->setConfigDir('smarty/configs/');
$this->setCacheDir('smarty/cache/');
$this->addPluginsDir('smarty/plugins/');
// turn on debugging for test site
if ($_SERVER["SERVER_ADDR"] == "127.0.0.1") {
$this->debugging = true;
} else {
$this->debugging = false;
}
}
} |
would I be correct in assuming that I should also create a class extending SmartyValidate so that I can Validate only those forms which will require validated data? |
|
Back to top |
|
jarnail Smarty n00b
Joined: 26 Aug 2008 Posts: 1
|
Posted: Mon Sep 17, 2012 11:43 am Post subject: Validator for smart version 2.6.12 |
|
|
I need this for my smarty version 2.6.12. This is maintaince site so I cant update it to latest but need to validate forms so can you provide me version of this compatible with my smart version 2.6.12 ?
Thanks in advance |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
dbj Smarty Rookie
Joined: 16 Nov 2017 Posts: 7
|
Posted: Tue Jan 16, 2018 1:50 pm Post subject: |
|
|
Is this plugin still compatible with the latest Smarty 3 version?
Can and shoul it stell be used, are there any known bugs? Are there actually any alternatives? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jan 18, 2018 1:49 pm Post subject: |
|
|
What does not work for you? |
|
Back to top |
|
dbj Smarty Rookie
Joined: 16 Nov 2017 Posts: 7
|
Posted: Thu Jan 18, 2018 1:53 pm Post subject: |
|
|
I'm currently evaluating options and have not tried SmartyValidate yet.
That's why I'm asking where the plugin stands in 2018, with the last update released 7 years ago.
Maybe it's working so good it did not need an update in all those years, but maybe the developer just stopped maintaining it, with some open issues... |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jan 18, 2018 3:26 pm Post subject: |
|
|
That does not look like you are validating anything.
Looks more like you want us to validate something for you. |
|
Back to top |
|
dbj Smarty Rookie
Joined: 16 Nov 2017 Posts: 7
|
Posted: Thu Jan 18, 2018 8:29 pm Post subject: |
|
|
Sorry, I don't want anyone to do anything for me.
Let me rephrase my question: Is someone who reads this using SmartyValidate and if yes, with success or with minor/major problems? (and on which Smarty and PHP version) |
|
Back to top |
|
|