Welcome Guest, Not a member yet? Register   Sign In
v4.5.1 Bug Fix Released
#4

Is i am found any bug?

I am using datatable library from https://codeigniter4-datatables.hermawan...age/basic/

In my view page
Code:
$('#custTable').DataTable({
            processing: true,
            serverSide: true,
            ajax: '<?= base_url('institute-lists') ?>',
            language: {
                "processing": "Loading. Please wait ..."
            },
            columns: [
                { data: 'name' },
                { data: 'identifier' },
                { data: 'inst_code' },
                { data: 'is_demo' },
            ]
 });

In Controller
PHP Code:
public function getInstituteList()
    {
        $inst_model  = new InstituteModel;

        $builder    $inst_model->select('name,identifier,inst_code,is_demo');

        return DataTable::of($builder)->toJson(true);
    

In ResponseTrait.php
PHP Code:
if ($cookie->isSecure() && ! $request->isSecure()) {
         throw SecurityException::forDisallowedAction();
   

Getting this error
Code:
institute-list:2254
<br />
<b>Fatal error</b>:  Uncaught CodeIgniter\Security\Exceptions\SecurityException: The action you requested is not allowed. in F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php:673
Stack trace:
#0 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(673): CodeIgniter\Security\Exceptions\SecurityException::forDisallowedAction()
#1 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(663): CodeIgniter\HTTP\Response-&gt;dispatchCookies()
#2 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(374): CodeIgniter\HTTP\Response-&gt;sendCookies()
#3 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\Debug\ExceptionHandler.php(83): CodeIgniter\HTTP\Response-&gt;send()
#4 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\Debug\Exceptions.php(163): CodeIgniter\Debug\ExceptionHandler-&gt;handle(Object(CodeIgniter\Security\Exceptions\SecurityException), Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), 403, 1)
#5 [internal function]: CodeIgniter\Debug\Exceptions-&gt;exceptionHandler(Object(CodeIgniter\Security\Exceptions\SecurityException))
#6 {main}
  thrown in <b>F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php</b> on line <b>673</b><br />
<br />
<b>Fatal error</b>:  Uncaught CodeIgniter\Security\Exceptions\SecurityException: The action you requested is not allowed. in F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php:673
Stack trace:
#0 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(673): CodeIgniter\Security\Exceptions\SecurityException::forDisallowedAction()
#1 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(663): CodeIgniter\HTTP\Response-&gt;dispatchCookies()
#2 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php(374): CodeIgniter\HTTP\Response-&gt;sendCookies()
#3 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\Debug\ExceptionHandler.php(83): CodeIgniter\HTTP\Response-&gt;send()
#4 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\Debug\Exceptions.php(163): CodeIgniter\Debug\ExceptionHandler-&gt;handle(Object(ErrorException), Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), 500, 1)
#5 F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\Debug\Exceptions.php(252): CodeIgniter\Debug\Exceptions-&gt;exceptionHandler(Object(ErrorException))
#6 [internal function]: CodeIgniter\Debug\Exceptions-&gt;shutdownHandler()
#7 {main}
  thrown in <b>F:\College ERP With Datatable\college_erp_v4_5_1\vendor\codeigniter4\framework\system\HTTP\ResponseTrait.php</b> on line <b>673</b><br />

After i have modify this code
PHP Code:
if ($cookie->isSecure() && ! $request->isSecure() && ! $request->isAJAX() ) {
            throw SecurityException::forDisallowedAction();
        

It works as expected

And if im directly use the  ajax url it works normally
Code:
http://localhost:8080/institute-lists?draw=1&columns%5B0%5D%5Bdata%5D=name&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=identifier&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=inst_code&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=is_demo&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1713534972736
Reply


Messages In This Thread
v4.5.1 Bug Fix Released - by kenjis - 04-13-2024, 09:33 PM
RE: v4.5.1 Bug Fix Released - by InsiteFX - 04-13-2024, 11:17 PM
RE: v4.5.1 Bug Fix Released - by lokman - 04-16-2024, 02:12 PM
RE: v4.5.1 Bug Fix Released - by LP_bnss - 04-20-2024, 06:56 AM
RE: v4.5.1 Bug Fix Released - by kenjis - 04-20-2024, 05:36 PM
RE: v4.5.1 Bug Fix Released - by LP_bnss - 04-21-2024, 06:39 AM
RE: v4.5.1 Bug Fix Released - by kenjis - 04-21-2024, 04:59 PM
RE: v4.5.1 Bug Fix Released - by LP_bnss - 04-23-2024, 12:42 AM
RE: v4.5.1 Bug Fix Released - by kenjis - 04-23-2024, 01:48 AM
RE: v4.5.1 Bug Fix Released - by LP_bnss - 04-23-2024, 03:02 AM
RE: v4.5.1 Bug Fix Released - by kenjis - 04-23-2024, 04:35 AM
RE: v4.5.1 Bug Fix Released - by LP_bnss - 04-23-2024, 04:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB