Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4.1.6 Released
#11

Not affected. The modification would just be removed when updating CI4.
Reply
#12

hi, I just updated CI

Could you help. I get this error

Undefined array key "file"

Code:
SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 142

Code:
135            $isDuplicate = $query['duplicate'] === true;
136
137            // Find the first line that doesn't include `system` in the backtrace
138            $line = [];
139
140            foreach ($query['trace'] as &$traceLine) {
141                // Clean up the file paths
142                $traceLine['file'] = str_ireplace(APPPATH, 'APPPATH/', $traceLine['file']);
143                $traceLine['file'] = str_ireplace(SYSTEMPATH, 'SYSTEMPATH/', $traceLine['file']);
144                if (defined('VENDORPATH')) {
145                    // VENDORPATH is not defined unless `vendor/autoload.php` exists
146                    $traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
147                }
148                $traceLine['file'] = str_ireplace(ROOTPATH, 'ROOTPATH/', $traceLine['file']);
149

Im running PHP 8.0.13
Reply
#13

Thank you CodeIgniter Development Team.
What did you Try? What did you Get? What did you Expect?

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

Great news and great work guys Smile
Website: marcomonteiro.net  | Blog: blog.marcomonteiro.net | Twitter: @marcogmonteiro | TILThings: tilthings.com
Reply
#15
Bug 

Happy new year!

Thanks for this release, but I encountered an problem in development environment.
It seems to be some problems with the Toolbar.

Displayed at 10:37:11am — PHP: 8.0.13 — CodeIgniter: 4.1.6

Code:
ErrorException
Undefined array key "file" search →

SYSTEMPATH/Debug/Toolbar/Collectors/Database.php at line 142

135            $isDuplicate = $query['duplicate'] === true;
136
137            // Find the first line that doesn't include `system` in the backtrace
138            $line = [];
139
140            foreach ($query['trace'] as &$traceLine) {
141                // Clean up the file paths
142                $traceLine['file'] = str_ireplace(APPPATH, 'APPPATH/', $traceLine['file']);
143                $traceLine['file'] = str_ireplace(SYSTEMPATH, 'SYSTEMPATH/', $traceLine['file']);
144                if (defined('VENDORPATH')) {
145                    // VENDORPATH is not defined unless `vendor/autoload.php` exists
146                    $traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
147                }
148                $traceLine['file'] = str_ireplace(ROOTPATH, 'ROOTPATH/', $traceLine['file']);
149

FULL BACKTRACE:
Code:
VENDORPATH/sentry/sentry/src/ErrorHandler.php : 303  —  CodeIgniter\Debug\Exceptions->errorHandler ()

296        $backtrace = $this->cleanBacktraceFromErrorHandlerFrames($errorAsException->getTrace(), $errorAsException->getFile(), $errorAsException->getLine());
297
298        $this->exceptionReflection->setValue($errorAsException, $backtrace);
299
300        $this->invokeListeners($this->errorListeners, $errorAsException);
301
302        if (null !== $this->previousErrorHandler) {
303            return false !== ($this->previousErrorHandler)($level, $message, $file, $line, $errcontext);
304        }
305
306        return false;
307    }
308
309    /**
310      * Tries to handle a fatal error if any and relay them to the listeners.
SYSTEMPATH/Debug/Toolbar/Collectors/Database.php : 142  —  Sentry\ErrorHandler->handleError ()

135            $isDuplicate = $query['duplicate'] === true;
136
137            // Find the first line that doesn't include `system` in the backtrace
138            $line = [];
139
140            foreach ($query['trace'] as &$traceLine) {
141                // Clean up the file paths
142                $traceLine['file'] = str_ireplace(APPPATH, 'APPPATH/', $traceLine['file']);
143                $traceLine['file'] = str_ireplace(SYSTEMPATH, 'SYSTEMPATH/', $traceLine['file']);
144                if (defined('VENDORPATH')) {
145                    // VENDORPATH is not defined unless `vendor/autoload.php` exists
146                    $traceLine['file'] = str_ireplace(VENDORPATH, 'VENDORPATH/', $traceLine['file']);
147                }
148                $traceLine['file'] = str_ireplace(ROOTPATH, 'ROOTPATH/', $traceLine['file']);
149
{PHP internal code}  —  CodeIgniter\Debug\Toolbar\Collectors\Database::CodeIgniter\Debug\Toolbar\Collectors\{closure} ()

SYSTEMPATH/Debug/Toolbar/Collectors/Database.php : 166  —  array_map()

SYSTEMPATH/Debug/Toolbar/Collectors/BaseCollector.php : 224  —  CodeIgniter\Debug\Toolbar\Collectors\Database->display ()

217      */
218    public function getAsArray(): array
219    {
220        return [
221            'title'          => $this->getTitle(),
222            'titleSafe'      => $this->getTitle(true),
223            'titleDetails'    => $this->getTitleDetails(),
224            'display'        => $this->display(),
225            'badgeValue'      => $this->getBadgeValue(),
226            'isEmpty'        => $this->isEmpty(),
227            'hasTabContent'  => $this->hasTabContent(),
228            'hasLabel'        => $this->hasLabel(),
229            'icon'            => $this->icon(),
230            'hasTimelineData' => $this->hasTimelineData(),
231            'timelineData'    => $this->timelineData(),
SYSTEMPATH/Debug/Toolbar.php : 90  —  CodeIgniter\Debug\Toolbar\Collectors\BaseCollector->getAsArray ()

83        $data['totalMemory']    = number_format((memory_get_peak_usage()) / 1024 / 1024, 3);
84        $data['segmentDuration'] = $this->roundTo($data['totalTime'] / 7);
85        $data['segmentCount']    = (int) ceil($data['totalTime'] / $data['segmentDuration']);
86        $data['CI_VERSION']      = CodeIgniter::CI_VERSION;
87        $data['collectors']      = [];
88
89        foreach ($this->collectors as $collector) {
90            $data['collectors'][] = $collector->getAsArray();
91        }
92
93        foreach ($this->collectVarData() as $heading => $items) {
94            $varData = [];
95
96            if (is_array($items)) {
97                foreach ($items as $key => $value) {
SYSTEMPATH/Debug/Toolbar.php : 368  —  CodeIgniter\Debug\Toolbar->run ()

361            if ($response instanceof DownloadResponse) {
362                return;
363            }
364
365            $toolbar = Services::toolbar(config(self::class));
366            $stats  = $app->getPerformanceStats();
367            $data    = $toolbar->run(
368                $stats['startTime'],
369                $stats['totalTime'],
370                $request,
371                $response
372            );
373
374            helper('filesystem');
375
SYSTEMPATH/Filters/DebugToolbar.php : 40  —  CodeIgniter\Debug\Toolbar->prepare ()

33      * If the debug flag is set (CI_DEBUG) then collect performance
34      * and debug information and display it in a toolbar.
35      *
36      * @param array|null $arguments
37      */
38    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
39    {
40        Services::toolbar()->prepare($request, $response);
41    }
42 }
43
SYSTEMPATH/Filters/Filters.php : 196  —  CodeIgniter\Filters\DebugToolbar->after ()

189                    continue;
190                }
191
192                return $result;
193            }
194
195            if ($position === 'after') {
196                $result = $class->after($this->request, $this->response, $this->argumentsClass[$className] ?? null);
197
198                if ($result instanceof ResponseInterface) {
199                    $this->response = $result;
200
201                    continue;
202                }
203            }
SYSTEMPATH/CodeIgniter.php : 429  —  CodeIgniter\Filters\Filters->run ()

422
423        // Never run filters when running through Spark cli
424        if (! defined('SPARKED')) {
425            $filters->setResponse($this->response);
426
427            // Run "after" filters
428            $this->benchmark->start('after_filters');
429            $response = $filters->run($uri, 'after');
430            $this->benchmark->stop('after_filters');
431        } else {
432            $response = $this->response;
433
434            // Set response code for CLI command failures
435            if (is_numeric($returned) || $returned === false) {
436                $response->setStatusCode(400);
SYSTEMPATH/CodeIgniter.php : 320  —  CodeIgniter\CodeIgniter->handleRequest ()

313            $this->response->pretend($this->useSafeOutput)->send();
314            $this->callExit(EXIT_SUCCESS);
315
316            return;
317        }
318
319        try {
320            return $this->handleRequest($routes, $cacheConfig, $returnResponse);
321        } catch (RedirectException $e) {
322            $logger = Services::logger();
323            $logger->info('REDIRECTED ROUTE at ' . $e->getMessage());
324
325            // If the route is a 'redirect' route, it throws
326            // the exception with the $to as the message
327            $this->response->redirect(base_url($e->getMessage()), 'auto', $e->getCode());
FCPATH/index.php : 45  —  CodeIgniter\CodeIgniter->run ()

38 /*
39  *---------------------------------------------------------------
40  * LAUNCH THE APPLICATION
41  *---------------------------------------------------------------
42  * Now that everything is setup, it's time to actually fire
43  * up the engines and make this app do its thang.
44  */
45 $app->run();
46
Reply
#16

(This post was last modified: 01-04-2022, 05:56 PM by kenjis.)

Temporary solution for Undefined array key "file":
https://github.com/codeigniter4/CodeIgni...1004850759
Reply
#17

Hi everyone! Just a quick update: we just released a hotfix as version 4.1.7 to address a few of the specific issues mentioned in this thread. Thank you for bringing the bugs to our attention, and a special thanks to @kenjis for getting this hotfix ready so fast!
Reply
#18

(01-04-2022, 05:56 PM)kenjis Wrote: Temporary solution for Undefined array key "file":
https://github.com/codeigniter4/CodeIgni...1004850759

(01-09-2022, 06:52 PM)MGatner Wrote: Hi everyone! Just a quick update: we just released a hotfix as version 4.1.7 to address a few of the specific issues mentioned in this thread. Thank you for bringing the bugs to our attention, and a special thanks to @kenjis for getting this hotfix ready so fast!

Thanks for all the good work guys!
Reply
#19

(01-09-2022, 06:52 PM)MGatner Wrote: Hi everyone! Just a quick update: we just released a hotfix as version 4.1.7 to address a few of the specific issues mentioned in this thread. Thank you for bringing the bugs to our attention, and a special thanks to @kenjis for getting this hotfix ready so fast!

Dear MGatner,
From 4.16 to 4.17, only call composer update, not other changes?
Thanks for help

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

Love CI & Thanks CI Teams

Reply
#20

(This post was last modified: 01-10-2022, 04:42 PM by kenjis.)

It seems the official User Guide is not updated.

See the work in progress User Guide:
Upgrading from 4.1.6 to 4.1.7 — CodeIgniter 4.1.7 documentation
https://codeigniter4.github.io/CodeIgnit...e_417.html
Version 4.1.7 — CodeIgniter 4.1.7 documentation
https://codeigniter4.github.io/CodeIgnit...4.1.7.html

The official User Guide is updated.

Upgrading From a Previous Version — CodeIgniter 4.1.7 documentation
https://www.codeigniter.com/user_guide/i...ading.html
Change Logs — CodeIgniter 4.1.7 documentation
https://www.codeigniter.com/user_guide/c...index.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB