Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: output "0" at the end of toolbar js when Kint::$enabled_mode is false #6809

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 2, 2022

Description
The following controller outputs 0 if you enable debug toolbar.
<script id="debugbar_loader" data-time="1667373293.313775" src="[http://localhost:8080/index.php?debugbar](view-source:http://localhost:8080/index.php?debugbar)"></script><script id="debugbar_dynamic_script"></script><style type="text/css" id="debugbar_dynamic_style"></style>0

<?php

namespace App\Controllers;

use Kint;

class Home extends BaseController
{
    public function index()
    {
        Kint::$enabled_mode = false;

        return '';
    }
}

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 2, 2022
@datamweb
Copy link
Contributor

datamweb commented Nov 2, 2022

Kenjis, I have this problem recently and I don't know why.
I know this is not related to PR, but I left this note.

toolbar

@kenjis
Copy link
Member Author

kenjis commented Nov 2, 2022

@datamweb I've never seen 500 error of index.php?debugbar_time.
If you see the CI4 log file, you may know something.

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen that 0! Mystery solved.

@kenjis kenjis merged commit b2b930d into codeigniter4:develop Nov 2, 2022
@kenjis kenjis deleted the fix-toolbar-kint-output-0 branch November 2, 2022 11:10
@datamweb
Copy link
Contributor

datamweb commented Nov 2, 2022

@datamweb I've never seen 500 error of index.php?debugbar_time. If you see the CI4 log file, you may know something.

Thanks Kenjis, I realized this problem is not related to CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants