Welcome Guest, Not a member yet? Register   Sign In
Validation Rules Group Error
#1

(This post was last modified: 02-15-2023, 05:48 PM by ailerux.)

I have a 4.0.4 project i am trying to port to 4.3.1 and so far so good except I am getting the error:
I believe 'login' is referring to my controller method authentication/login
 
Code:
login is not a validation rules group


The offending line is here... was there a change between 4.0.4 and 4.3.1 that broke this?

PHP Code:
if (!$validation->withRequest($this->request)->run($_POST'login')) { }


The entire error stack:

Uncaught Error.
{
    "title""CodeIgniter\\Validation\\Exceptions\\ValidationException",
    "type""CodeIgniter\\Validation\\Exceptions\\ValidationException",
    "code"500,
    "message""\"/login\" is not a validation rules group.",
    "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/Validation/Validation.php",
    "line"619,
    "trace": [
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/Validation/Validation.php",
            "line"619,
            "function""forGroupNotFound",
            "class""CodeIgniter\\Validation\\Exceptions\\ValidationException",
            "type""::"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/Validation/Validation.php",
            "line"118,
            "function""loadRuleGroup",
            "class""CodeIgniter\\Validation\\Validation",
            "type""->"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/app/Controllers/Authentication.php",
            "line"44,
            "function""run",
            "class""CodeIgniter\\Validation\\Validation",
            "type""->"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/CodeIgniter.php",
            "line"934,
            "function""authenticateLoginAjax",
            "class""App\\Controllers\\Authentication",
            "type""->"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/CodeIgniter.php",
            "line"499,
            "function""runController",
            "class""CodeIgniter\\CodeIgniter",
            "type""->"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/vendor/codeigniter4/framework/system/CodeIgniter.php",
            "line"368,
            "function""handleRequest",
            "class""CodeIgniter\\CodeIgniter",
            "type""->"
        },
        {
            "file""/var/www/vhosts/mydomain.com/dev.mydomain.com/public/index.php",
            "line"67,
            "function""run",
            "class""CodeIgniter\\CodeIgniter",
            "type""->"
        }
    ]


This is being called from AJAX:

Code:
$.ajax({
    type: 'POST',
    url: base_url + "/authenticateLoginAjax",
    data: {'username': username,  'password': password},
    dataType: 'json',
    success : function(response) {
        console.log(response.errors);
        if (response.errors === undefined || response.errors.length == 0) {
            window.location = response.url;
        } else {
            setTimeout(function() {
                console.log('errors');
                $('.form-row.messages').hide();
                $('.form-row.messages').removeClass('authenticating').addClass('error').fadeIn();
                $('.form-row.messages span').html(response.errors.username);
            }, 2000);
        }
    }, error : function(jqXHR, exception) {
        var message = 'Uncaught Error.\n' + jqXHR.responseText;
        console.log(message);
    }
});
return false;
Reply


Messages In This Thread
Validation Rules Group Error - by ailerux - 02-15-2023, 05:40 PM
RE: Validation Rules Group Error - by kenjis - 02-15-2023, 06:03 PM
RE: Validation Rules Group Error - by ailerux - 02-15-2023, 08:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB