-
Notifications
You must be signed in to change notification settings - Fork 915
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
Use passed request before fallback to global one #34
Conversation
…parameter or fallback to global instance
Hmm... I've come to trust you, @fede91it , so I'll definitely merge this last commit, but I'm just wondering - where did you encounter this problem and when can the request be null? Thanks! |
Through store or update methods are called the relative storeCrud or updateCrud methods. but they always use the global request instance instead of using their $request parameter, that by default was set to null. With the check, I add I choose to use the global request only if the passed parameter isn't present, as before, but I use it if there is. This behavior is useful to manipulate the request sent by the admin form before its parameters will be stored by crud controller. Please let me know if I sent any wrong or nonsense PR. I really want to help the project because the project is helping me a lot, so I want to contribute to say ma thank you. |
You're perfectly right. Don't worry about it, it's not nonsense, I just wanted to understand it and sometimes I'm a bit thick headed :-) You're doing a great job, by the way, you're probably already the #2 contributor to the package :-) I merged it now, thanks! PS. Please remember to do a git pull in your fork every time before you publish a PR, otherwise github will merge all your PRs into one. For now it's manageable, but soon enough it will be difficult to understand what each PR does. (note: i'm not sure this is the solution, i'm just guessing) Cheers! |
Oh thank you, since now I only did a reporisoty fetch but no a real pull. |
Sure, definitely want to see that! |
When a $request parameter is provided, storeCrud and updateCrud uses that before fallback to global request instance:
If the parameter is not passed, as before, the used request will be
\Request::instance()