Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v4.5.0 Released!
#1

(This post was last modified: 04-25-2024, 12:30 AM by kenjis.)

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...0.html#id9

ChangeLog: https://codeigniter4.github.io/userguide...4.5.0.html
Upgrading Guide: https://codeigniter4.github.io/userguide...e_450.html

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

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.
Reply
#3

Thank you CodeIgniter 4 Development Team for your hard work.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

Thank you !

Doc in https://codeigniter.com/user_guide/insta...ading.html is not update
Reply
#5

good news!
Reply
#6

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
Dirk B.
Abatrans Software
No SEO spam - see forum guidelines
Reply
#7

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?st...pt=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?
Reply
#8

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

@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
Reply
#10

(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();
Reply




Theme © iAndrew 2016 - Forum software by © MyBB