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: module filters are not discovered when using route filters #5280

Merged
merged 4 commits into from Nov 7, 2021

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 3, 2021

Description
Fixes #4720

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 changed the title fix: module filters are not discovered when route filters used fix: module filters are not discovered when using route filters Nov 3, 2021
@iRedds
Copy link
Collaborator

iRedds commented Nov 3, 2021

Yes, this solution works.
But what if we move the search for filters to the class constructor?

@kenjis
Copy link
Member Author

kenjis commented Nov 3, 2021

@iRedds I moved it. Does it work?

@iRedds
Copy link
Collaborator

iRedds commented Nov 3, 2021

@kenjis You asks me? How about tests? =)

@kenjis
Copy link
Member Author

kenjis commented Nov 3, 2021

@iRedds Yes, of course. You are the only one user for this functionality in this planet.
Most important. :-)

@kenjis
Copy link
Member Author

kenjis commented Nov 3, 2021

@michalsn #3459 (comment)

Is there something wrong with moving$this->discoverFilters() back to the constructor?

I think the Filters files in the namespace are determined at the time of the instance creation,
so it seems better to execute it once in the constructor.

@michalsn
Copy link
Member

michalsn commented Nov 4, 2021

I think this is a good fix.

Can we add a test for this to make sure it won't be moved around anymore?

@kenjis
Copy link
Member Author

kenjis commented Nov 5, 2021

@michalsn Thanks! I added a test.

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.

Looks good to me.

@kenjis kenjis merged commit 6b882e9 into codeigniter4:develop Nov 7, 2021
@kenjis kenjis deleted the fix-module-route-filter branch November 7, 2021 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Module route filters not loading
3 participants