Skip to content

Conversation

michalsn
Copy link
Member

Description
This PR fixes an issue with controller attribute filters that use parameters. See: #9745 (comment)

Filter parameters are always declared as strings elsewhere in the framework, and there is no supported way to handle them differently. See:

To maintain consistency, this change ensures that filter parameters are treated as strings, matching the existing convention. Any other behavior would introduce inconsistency.

All existing tests have been kept, even those that may not make much sense in this context, to serve as examples of how filters handle mixed-type parameters (they are converted to strings).

This change only affects Filters - everything else will continue to behave as before.

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

@michalsn michalsn requested a review from lonnieezell October 23, 2025 08:40
@michalsn michalsn added bug Verified issues on the current code behavior or pull requests that will fix them 4.7 labels Oct 23, 2025
Copy link
Member

@lonnieezell lonnieezell left a comment

Choose a reason for hiding this comment

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

My bad for the bad example in the docs. That was definitely an oops on my part.

But this solution seems good. I don't see any issues, and allows a little more flexibility on the user end.

@michalsn michalsn merged commit 6a64c4c into codeigniter4:4.7 Oct 23, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.7 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.

2 participants