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: cannot create shared View instance when using debugbar #7172

Merged
merged 3 commits into from
Jan 29, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jan 24, 2023

Description

  • (1) fix: DebugBar initializes shared renderer instance
  • (2) fix: Event collector does not collect Timeline data

(1)
DebugBar initializes shared renderer instance.
The following code in a controller does not create a new instance with the view path.

\Config\Services::renderer(__DIR__ . '/../Views');

(2)
After:
Screenshot 2023-01-24 16 18 54

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 Jan 24, 2023
@@ -63,7 +63,7 @@ class Events extends BaseCollector
*/
public function __construct()
{
$this->viewer = Services::renderer();
$this->viewer = Services::renderer(null, null, false);
Copy link
Member

Choose a reason for hiding this comment

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

Would it be clearer to use single_service('renderer') here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Using not shared service was wrong. Because the shared View has the performance data.
I will fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@kenjis kenjis marked this pull request as draft January 24, 2023 06:40
It does not return anything.
@kenjis kenjis merged commit b302f15 into codeigniter4:develop Jan 29, 2023
@kenjis kenjis deleted the fix-debugbar-collectors-viewer branch January 29, 2023 23:28
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