Skip to content

Conversation

mjomble
Copy link
Contributor

@mjomble mjomble commented Sep 18, 2025

Description
Fixed bug introduced in #9581 and described in this comment

  • isEmpty() was checking the opposite
  • The checks did not work if $this->data was null

Checklist:

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

@mjomble
Copy link
Contributor Author

mjomble commented Sep 18, 2025

I'll look into adding a unit test for the Logs controller

@mjomble mjomble marked this pull request as draft September 18, 2025 09:22
@mjomble mjomble marked this pull request as ready for review September 18, 2025 10:42
Copy link

mergeable bot commented Sep 18, 2025

Hi there, mjomble! 👋

Thank you for sending this PR!

We expect the following in all Pull Requests (PRs).

Important

We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.

If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
on the framework than you do. Please make it as painless for your contributions to be included as possible.

See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

Sincerely, the mergeable bot 🤖

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

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

The code change and added test looks good. Thanks for that. However, I'm not sure about adding the default [] to the $data property. Well, theoretically this is a breaking change as the initial state would now be [] instead of null. But, practically speaking, the intent was to treat $data as an array. It's just probably that when this class was created, typed properties were not yet a thing. So, this is a bug fix.

Let's hear from others on their take on this.

Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

LGTM!

michalsn
michalsn previously approved these changes Sep 27, 2025
Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

In this case, I’m fine with treating changes to the $data property as a bug fix, though I hope this doesn't open the door to making similar adjustments too easily in the future.

@paulbalandan paulbalandan added the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 27, 2025
@michalsn
Copy link
Member

@mjomble Please also add a changelog entry, here: https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/changelogs/v4.6.4.rst#bugs-fixed

PHPStan errors should be gone after merging #9728, so you don't have to worry about it.

@michalsn michalsn dismissed their stale review October 1, 2025 06:19

Changelog entry is missing

@mjomble
Copy link
Contributor Author

mjomble commented Oct 1, 2025

I've updated the changelog

@michalsn michalsn requested a review from paulbalandan October 1, 2025 06:47
@paulbalandan paulbalandan changed the title fix: Debug toolbar logs controller fix: debug toolbar logs collector behavior on isEmpty() Oct 1, 2025
@paulbalandan paulbalandan merged commit b352164 into codeigniter4:develop Oct 1, 2025
50 checks passed
@paulbalandan
Copy link
Member

thank you @mjomble

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.

5 participants