Skip to content

Commit fa27b95

Browse files
authored
Fixing bug with legacy autoRoute
When legacy autoRoute is used in case of using controller that sits in sub directory, that directory is determined and stored in $this->directory and new AutoRouter class. But if we subsequently try to load controller without that is not in a directory, then codeigniter can't find it because the $this->directory var in AutoRoute instance is still holding reference to previous directory. This only happens when we load several controllers from console. In my case after upgrading to 4.2.11 my tests fail because of it. I suggest to remove this return; statement to reset directory in AutoRoute instance also.
1 parent 9d255cd commit fa27b95

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

system/Router/Router.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,6 @@ public function setDirectory(?string $dir = null, bool $append = false, bool $va
574574
{
575575
if (empty($dir)) {
576576
$this->directory = null;
577-
578-
return;
579577
}
580578

581579
if ($this->autoRouter instanceof AutoRouter) {

0 commit comments

Comments
 (0)