CodeIgniter Forums
CodeIgniter v4.5.0 Released! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: News & Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=2)
+--- Thread: CodeIgniter v4.5.0 Released! (/showthread.php?tid=90586)

Pages: 1 2 3 4


CodeIgniter v4.5.0 Released! - kenjis - 04-07-2024

We have released v4.5.0 with many enhancements!

v4.5.0 is a minor upgrade. It includes enhancements and bug fixes.
It requires PHP 8.1 or later.

Unfortunately, there are many breaking changes in v4.5.0,
However, many users will be unaffected by most of the breaking changes.
All of these changes provide more appropriate behavior.

But a few breaking changes break your apps, so please upgrade with caution.
Read ChangeLog and Upgrading Guide carefully.
At least, you must update public/index.php and spark file.

Also, many deprecated items have been removed. So if you have deprecated code in your apps,
they may be broken.

And some of the default Config values in the Config files have changed, but Config files are not updated automatically. 
It is recommended to update Config values.

This release contains over 30 enhancements. A few things I would like to highlight:
- CORS filter
- The spark optimize command for performance improvement on production environment
- New property Model::$updateOnlyChanged to avoid “There is no data to update” error
- The spark lang:find command to update translations keys

You can see the list of enhancements in https://codeigniter4.github.io/userguide/changelogs/v4.5.0.html#id9

ChangeLog: https://codeigniter4.github.io/userguide/changelogs/v4.5.0.html
Upgrading Guide: https://codeigniter4.github.io/userguide/installation/upgrade_450.html

Note: Unfortunately now the User Guide on the official site is not yet updated due to the deployment trouble.


RE: CodeIgniter v4.5.0 Released! - Bosborne - 04-07-2024

Thank you.

Just curious. How do you define this as a minor upgrade? In my opinion breaking changes make this a major upgrade.

I have been trying to figure out the release philosophy on versions with breaking changes. I am working on several Codeigniter based enterprise sites and do not want to get caught up in a Codeigniter upgrade cycle always fixing breaking changes in my code.

Thanks again for maintaining this great framework.


RE: CodeIgniter v4.5.0 Released! - InsiteFX - 04-07-2024

Thank you CodeIgniter 4 Development Team for your hard work.


RE: CodeIgniter v4.5.0 Released! - paul - 04-07-2024

Thank you !

Doc in https://codeigniter.com/user_guide/installation/upgrading.html is not update


RE: CodeIgniter v4.5.0 Released! - zidon - 04-07-2024

good news!


RE: CodeIgniter v4.5.0 Released! - abatrans - 04-07-2024

Thanks for the new release.

I think I found a bug:

Code:
CRITICAL - 2024-04-07 23:31:59 --> TypeError: str_contains(): Argument #1 ($haystack) must be of type string, null given
[Method: GET, Route: /]
in SYSTEMPATH\Debug\Toolbar.php on line 436.
1 SYSTEMPATH\Debug\Toolbar.php(436): str_contains()
2 SYSTEMPATH\Filters\DebugToolbar.php(43): CodeIgniter\Debug\Toolbar->prepare()
3 SYSTEMPATH\Filters\Filters.php(244): CodeIgniter\Filters\DebugToolbar->after()
4 SYSTEMPATH\Filters\Filters.php(291): CodeIgniter\Filters\Filters->runAfter()
5 SYSTEMPATH\CodeIgniter.php(409): CodeIgniter\Filters\Filters->runRequired()
6 SYSTEMPATH\CodeIgniter.php(372): CodeIgniter\CodeIgniter->runRequiredAfterFilters()
7 SYSTEMPATH\Boot.php(312): CodeIgniter\CodeIgniter->run()
8 SYSTEMPATH\Boot.php(67): CodeIgniter\Boot::runCodeIgniter()
9 FCPATH\index.php(56): CodeIgniter\Boot::bootWeb()

I changed line 436 in 
SYSTEMPATH\Debug\Toolbar.php to
PHP Code:
if (str_contains((string)$response->getBody(), '<head>')) { 
and it solved the problem


RE: CodeIgniter v4.5.0 Released! - warcooft - 04-07-2024

Thank You.
After upgrading using composer update and merging spark and public/index.php files I got an error like the following:

URL: http://localhost:8080/oauth/call-back?state=3a8b4afeb30d7e1522b558a5b76ee8caa97738d1&code=4%2F0AeaYSHDbjlAw0XvXS4_EL9d1AR1JM7nOs3dWAzrDu-vQruiye1dagKk_u8EOYl7TMsBoTw&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=consent

Response:
Call to a member function getErrors() on null 
VENDORPATH/codeigniter4/shield/src/Models/CheckQueryReturnTrait.php at line 44

Code:
protected function checkValidationError(): void
43    {
44        $validationErrors = $this->validation->getErrors();
45        if ($validationErrors !== []) {
46            $message = 'Validation error:';
47
48            foreach ($validationErrors as $field => $error) {
49                $message .= ' [' . $field . '] ' . $error;
50            }


Maybe there's still something missing that needs to be updated?


RE: CodeIgniter v4.5.0 Released! - kenjis - 04-07-2024

@abatrans Thanks. I sent a PR to fix: https://github.com/codeigniter4/CodeIgniter4/pull/8727


RE: CodeIgniter v4.5.0 Released! - kenjis - 04-07-2024

@warcooft I don't know why the error occurs.
It shows $this->validation is null.
If you believe it is a bug, report to Shield repository.
https://github.com/codeigniter4/shield/issues


RE: CodeIgniter v4.5.0 Released! - warcooft - 04-07-2024

(04-07-2024, 04:24 PM)kenjis Wrote: @warcooft I don't know why the error occurs.
It shows $this->validation is null.
If you believe it is a bug, report to Shield repository.
https://github.com/codeigniter4/shield/issues
Thanks for quick response, After fixing the error, I found a new error like the following:


TypeError
pg_escape_literal(): Argument #2 ($string) must be of type string, CodeIgniter\I18n\Time given 

SYSTEMPATH/Database/Postgre/Connection.php at line 242
Code:
235
236        /** @psalm-suppress NoValue I don't know why ERROR. */
237        if (is_string($str) || (is_object($str) && method_exists($str, '__toString'))) {
238            if ($str instanceof RawSql) {
239                return $str->__toString();
240            }
241
242            return pg_escape_literal($this->connID, $str);
243        }
244
245        if (is_bool($str)) {
246            return $str ? 'TRUE' : 'FALSE';
247        }
248
249        /** @psalm-suppress NoValue I don't know why ERROR. */


Is it true that Postgres DB doesn't fully support it yet, because previously there were several problems? like disable foreign check doesn't work but works fine when using MySQL:

$this->db->disableForeignKeyChecks();