Callback function are not working... |
[eluser]boltsabre[/eluser]
Hi everyone, Can anyone confirm (or deny) if there is a bug with callback validation functions. I recently upgraded my project from an older version of CI to V2.1.3, and was testing an old part of the site before launching it to my test server, however, my callback functions are not working. I've even tried with the exact example from the user guide and that's not working either. 1. Form validation library IS loaded (required, and other CI validation functions are working). 2. Functions in libraries/MY_Form_validation ARE working as expected. 3. It's just one callback function I have that isn't working. Here's the code: Code: function edit_job(){ Having a look at the core form valiation library, I think I've isolated where there problem is, but have no idea why, or how, to fix it: Code: //System/libraries/Form_validation.php, line 584 If anyone has any idea on why my callback function (even the exact copy of the one from the user manual) is failing, I'd be extremely grateful, this is driving me nuts and I'm desperately trying to get my site onto my test server within the next two weeks!!! Don't know if it makes any difference, but the controller is extending MY_Controller, which in turn is extending MX_Controller for hmvc...
[eluser]boltsabre[/eluser]
Okay, looks like no-one really has a clue on this. That's okay, I'll keep at it tonight when I get home from work. However, if someone could do a little test for me to help isolate the problem I'd be extremely grateful!!! In System/libraries/Form_validation.php, line 584, can someone test this (from a controller/form that has a callback function) Code: // Call the function that corresponds to the rule I'm interested specifically in this line of code: Code: var_dump(method_exists($this->CI, $rule)); //prints bool(false), but it should be true!!! But yeah, if someone could test this for me on one of their CI websites I'd be very grateful, many many many thanks in advance!
[eluser]Otemu[/eluser]
Hi, There was an issue with callbacks using HMVC Quote:When using form validation with MX you will need to extend the CI_Form_validation class as shown below, Here id another solution Hopefully that helps if not I can test for you tomorrow
[eluser]boltsabre[/eluser]
Thanks Otemu, that's great! I did a few online searches for "CI/codeigniter callback function not working" but didn't see anything regarding hmvc, obviously I didn't dig deep enough last night. I'll check this out tonight when I get home from work and let you know what that status is. Thanks again, you've become a really active and useful contributor on this forum, it's great to see!
[eluser]Otemu[/eluser]
I had same issue with callbacks, after installing hmvc all my callbacks failed after searching around found the solution so hopefully it works for you too. I do enjoy helping the community, so I try my best when I can and am glad someone noticed lol :-)
|
Welcome Guest, Not a member yet? Register Sign In |