-
Notifications
You must be signed in to change notification settings - Fork 133
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
bug: Call to a member function inGroup() on null after logging out #576
Conversation
Thank you for the contribution! This PR makes sense to me. We need your GPG sign to your commits. Please sign. |
Thank you, I didn't know about that. Just signed the commit and pushed the update, let me know if anything else is needed |
@cornejobarraza Thanks, can you write the php unit test for this PR? see : |
Hi @datamweb, I think I ran the tests correctly and some files were generated, but those seem to be in the |
Running a test is different from writing a test.
We have: Lines 53 to 56 in ca7335c
so this issue does not create a problem for the new test. I did not understand your point in this regard. When you execute the test command, the existing tests are executed.
Welcome. Don't worry, this PR will remain open until you write the corresponding test. |
@datamweb The code is covered by existing test code. So I think this PR is okay with no additional test case. If we write a test case that reproduces the bug, we need to write an anonymous class which extends |
I agree., my emphasis was because of label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cornejobarraza thanks, merged.
I have declared the following under my
Auth.php
file:And get a Call to a member function inGroup() on null error when navigating to
/logout
.After some debugging I realized the logout action function under
LoginController.php
logs the user out before redirecting, causing theredirect()
helper to get an invalid value.To overcome this, I first capture the URL in a variable and pass it to the redirect function after the auth is logged out:
This is my first time contributing to CodeIgniter, I'm not sure if I did this correctly so please let me know if I should change something, or even if this should not be considered an issue as it's not something CI Shield sets up out of the box.
Thank you and have a good one!