Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v4.3.8 and v4.4.0 Released!

(This post was last modified: 08-26-2023, 03:59 AM by nc03061981.)


PHP Code:
CRITICAL 2023-08-26 12:35:07 --> CodeIgniter\Router\RouteCollection::__construct(): Argument #3 ($routing) must be of type Config\Routing, null given, called in /home/xvcoagjb/abc.com/vendor/codeigniter4/framework/system/Config/Services.php on line 617
in SYSTEMPATH/Router/RouteCollection.php on line 283.
/Config/Services.php(617): CodeIgniter\Router\RouteCollection->__construct()
2 SYSTEMPATH/Config/BaseService.php(199): CodeIgniter\Config\Services::routes()
3 SYSTEMPATH/Config/Services.php(614): CodeIgniter\Config\BaseService::getSharedInstance()
4 SYSTEMPATH/CodeIgniter.php(783): CodeIgniter\Config\Services::routes()
5 SYSTEMPATH/CodeIgniter.php(442): CodeIgniter\CodeIgniter->tryToRouteIt()
6 SYSTEMPATH/CodeIgniter.php(353): CodeIgniter\CodeIgniter->handleRequest()
7 FCPATH/index.php(79): CodeIgniter\CodeIgniter->run() 

Learning CI4 from my works, from errors and how to fix bugs in the community

Love CI & Thanks CI Teams


Thank you CodeIgniter Development Team Great Job!
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

(This post was last modified: 08-27-2023, 09:12 AM by chaos.)

Hi, after upgrade this gived null:

$cfgoption_model = model('App\Model\CfgOptionModel');

SOLVED: i replaced app\Model with app\Models... i wonder why it was working before...

(This post was last modified: 08-27-2023, 02:06 PM by kenjis.)

Quote:Now preferApp works only when you request a classname without a namespace.


For example, in a controller (namespace App\Controllers), if you called config(Config\App::class) by mistake (note the class is missing the leading \), meaning you actually passed App\Controllers\Config\App. But that class does not exist, so now Factories will return null.

See https://codeigniter4.github.io/CodeIgnit...#factories

Your case is the same thing. 
Previously, classes were searched by short classname alone, but starting with 4.4.0, classes with namespaces are now searched only for that specified class.

(This post was last modified: 08-28-2023, 08:50 AM by boddah85.)

After update I've got a little problem:

Call to undefined method Myth\Auth\Entities\User::getAvatar()

Im just trying to echo it in controller App\Controllers\Page

PHP Code:
echo user()->getAvatar() 

Thanks in advance for any help.


PHP Code:
<?php namespace App\Entities;

Myth\Auth\Entities\User as MythUser;

User extends MythUser
    * Default attributes.
    * @var array
    protected $attributes = [
    'user_info' => ''
 * getEmail address
 * @return void
public function getEmail()
        return trim($this->attributes['email']);
    * getAvatar
    * @return void
    public function getAvatar()
/* */

Hi, after upgrade to 4.4.0 I have the following CRITICAL error:

CRITICAL - 2023-08-28 17:49:27 --> assert($currentURI instanceof SiteURI)
in SYSTEMPATH\Helpers\url_helper.php on line 34.
1 SYSTEMPATH\Helpers\url_helper.php(34): assert(false, 'assert($currentURI instanceof SiteURI)')
2 SYSTEMPATH\Helpers\url_helper.php(151): site_url('/battle/view/7', null, Object(Config\App))
3 APPPATH\Models\BattleModel.php(865): anchor('/battle/view/7', 'here')stdClass

This piece of code creates it:

PHP Code:
$characterevent_model->add(1'towncrier'"App.event_battleexecuted;"$this->battle['id'] ."," 
anchor("/battle/view/{$this->battle['id']}"'here') . "," 
$this->battle['source']['name'] . "," .
$this->battle['target']['name'] . "," .
$winnertext "," .

Any clue? Thanks

@boddah85 See https://codeigniter4.github.io/CodeIgnit...-factories

@chaos Did you customize Services for URI or Request?
Since v4.4.0, Services::request()->getUri() must return the SiteURI instance.

I upgraded my system to the latest version; I hadn't experienced any issues with any version until today when I updated to version v4.4.0. Now, I'm encountering an error as if it can't find the ENVIRONMENT in the Codeigniter.php file:

Fatal error: Uncaught Error: Undefined constant "CodeIgniter\ENVIRONMENT" in /mysite.com/vendor/codeigniter4/framework/system/CodeIgniter.php:581

When opening the file, I do see the definition of the ENVIRONMENT variable.

protected function detectEnvironment()
// Make sure ENVIRONMENT isn't already set by other means.
if (! defined('ENVIRONMENT')) {
define('ENVIRONMENT', env('CI_ENVIRONMENT', 'production'));

* Load any custom boot files based upon the current environment.
* If no boot file exists, we shouldn't continue because something
* is wrong. At the very least, they should have error reporting setup.
protected function bootstrapEnvironment()
if (is_file(APPPATH . 'Config/Boot/' . ENVIRONMENT . '.php')) {
require_once APPPATH . 'Config/Boot/' . ENVIRONMENT . '.php';
} else {
// @codeCoverageIgnoreStart
header('HTTP/1.1 503 Service Unavailable.', true, 503);
echo 'The application environment is not set correctly.';

// @codeCoverageIgnoreEnd


There are some breaking changes in v4.4.0, so please upgrade with caution.
Please read ChangeLog and Upgrading Guide very carefully:
- https://codeigniter4.github.io/CodeIgnit...4.4.0.html
- https://codeigniter4.github.io/CodeIgnit...e_440.html

Theme © iAndrew 2016 - Forum software by © MyBB