Error in Generator Code
Error in Generator Code
I get the following error when I create a new record using the Gerenrator code on my local XAMPP server :
Warning: call_user_func() expects parameter 1 to be a valid callback, class '\DataTables\Editor\Validate' not found in C:\--Projects--\test\php\lib\Editor\Field.php on line
This discussion has been closed.
Answers
I downloaded the complete package and placed it in a directory.
A system error has occurred (More information).
Warning: call_user_func() expects parameter 1 to be a valid callback, class '\DataTables\Editor\Validate' not found in C:\--Projects--\test\php\lib\Editor\Field.php on line
Hi,
Could you let me know what validation options you have selected, and/or paste the generated PHP into this conversation and I'll fix that. Thanks!
Allan
Thanks for the code. I'm having problems reproducing this issue I'm afraid - I've just setup a similar generator table and it appears to run as expected.
Could you check in the
php/lib/Editor
directory and make sure that there is aValidate.php
file there please? Also, what version of PHP are you using?Allan
Yes there is a Validate.php file and the version of PHP I am using is PHP Version 5.3.1
I have a feeling that this is a namespace bug in early versions of PHP 5.3.x. There were some really wacky bug in the early 5.3 series. I suspect it isn't resolving the Validate library from the
use
statement like it should.If you were to use:
does that resolve the issue (or possibly without the leading
\
)?The other option is to update to a newer version of 5.3.x (or even 5.x).
Allan