Updates in Framework Codeigniter 4.4.4 to 4.5.2


There are several new features and changes than ocurred in  the new version in the framework PHP named CodeIgniter 4.

The news  you can see in the official web page https://codeigniter4.github.io/userguide/installation/upgrade_450.html

For update you old proyect first you have replace the files spark and index.php, take as origen the files from vendor/codeigniter4

If you uses Linux derivated Debian can use the next commands.

cp vendor/codeigniter4/framework/public/index.php public/index.php
cp vendor/codeigniter4/framework/spark spark

 In uor case, we had problem with the librery Myth/Auth,  not saved users, and launch the next error

Could not check compatibility between Myth\Auth\Authentication\Passwords\CompositionValidator::check(string $password, ?CodeIgniter\Entity\Entity $user = null): bool and Myth\Auth\Authentication\Passwords\ValidatorInterface::check(string $password, ?CodeIgniter\Entity $user = null): bool, because class CodeIgniter\Entity is not available in D:\proyectoCodeIgniter\vendor\julio101290\auth\src\Authentication\Passwords\CompositionValidator.php

The solution is replace the line CodeIgniter\Entity; with use CodeIgniter\Entity\Entity; in the file proyectoCodeIgniter\vendor\julio101290\auth\src\Authentication\Passwords\ValidatorInterface.php

Although it has already been corrected in the repository https://github.com/julio101290/myth-auth/releases/tag/v1.2.8


If you use this fork then run "Composer Update" in the project

Other problem is in the librery Boilerplate with the file routes.php,

May be resources not work automatic the update, then add the next code in routes.php

/** * Users Update */
 $routes->post('user/manage/(:any)/update', 'UserController::update/$1',
             [ 'filter' => 'permission:back-office', 'namespace' => 'julio101290\boilerplate\Controllers\Users',             'except' => 'show', 'as' => 'update', ]); 

$routes->post('role/(:any)/update', 'RoleController::update/$1',
         [ 'filter' => 'permission:role-permission', 'namespace' =>             'julio101290\boilerplate\Controllers\Users', 'except' => 'show', 'as' => 'updateRole', ]);




Although it has already been corrected in the repository https://github.com/julio101290/boilerplate/releases/tag/v1.3.8


*************************************

Other correction whats needs to be done are the request ajax, in the method name change  from upper case to lower case


For example before

 ajax: {

            url: '<?= base_url('admin/sells') ?>',

            method: 'GET',

            dataType: "json"

        },..........................


Later

ajax: {

            url: '<?= base_url('admin/sells') ?>',

            method: 'get',

            dataType: "json"

        },

*************************************

Other error is in the model, when launch the next message

CodeIgniter\\Database\\BaseBuilder::getOperatorFromWhereKey():
Argument #1 ($whereKey) must be of type string, int given


For fix that error, in our case check the sentence where in the query builder

For example,

Before

->where('0', $company)

Later

->where('\'0\'', $company,true)


*************************************



Comments

Popular posts from this blog

🛡️ The Ultimate Guide and Technical Manual for CyberBackup (Bender Rodríguez Edition): The Only Backup System That Respects Humans... In Its Own Way

🚀 Automating and Controlling SAP Vouchers with CodeIgniter 4, ODBC, and Service Layer: The Ultimate Guide & SapVouchersController Module

📷 How to Install V380 Pro on Linux Mint (Step by Step)

🚀 How to Automate TikTok Shorts Uploads from Linux: Playwright, Local AI (Ollama), and Systemd Without Getting Banned

🤠⚡ Deconstructing MySQL Error 150: How a Corrupted Dump Turned into a Cyberpunk SQL Injector