-
-
Notifications
You must be signed in to change notification settings - Fork 85
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 parameter parsing in wp-cli civicrm api. #114
Conversation
The entity and action were also being parsed as an invalid parameter. This was fixed by shifting the args array after parsing them. An unassigned $format variable was being referenced inside of the default case for the switch statement if the --in option was neither args nor json. This was fixed by assigning $format to the output of getOption rather than switching on getOption directly. The parameter matching regex had spaces added to it in pull request civicrm#110 that caused arguments of the format foo=bar to not be matched correctly, so no parameters were actually being passed to the underlying api method. The spaces were removed from the regex and the parsing worked. Two other regex matches had spaces added to them by pull request civicrm#110 that I have not touched, but they seem suspect.
Looks like this is your first patch for A couple things:
|
@jonesinator Thanks for the patch. Can you detail the issue you are having with steps to reproduce? I agree the spacing added in #110 needs to be fixed. I've applied the patch to my local dev env and I am getting the following error on any wp cv command:
I am testing against the latest master branch, I get this error wth both php 7.0 and php 5.6. Any details on your environment would be helpful as well. |
Sorry, not sure how a semicolon disappeared between my testing and my commit. Your parsing error should be fixed by my latest patch. Also, apologies for not creating an issue in Jira. I'll try to follow the correct procedure with any changes in the future. I'm only testing on php 7.0 at the moment. My issue is that any For example, prior to the fix, the command |
@jonesinator Thanks again for the patch and the details on how to reproduce. Reproduced with the current civicrm.php file. Applied patch. Patch applies cleanly and now accepts arguments properly. @totten This looks good to merge. I'd target 4.7.25 |
Thank you, @jonesinator @kcristiano . Merging into |
The entity and action were also being parsed as an invalid parameter.
This was fixed by shifting the args array after parsing them.
An unassigned $format variable was being referenced inside of the
default case for the switch statement if the --in option was neither
args nor json. This was fixed by assigning $format to the output of
getOption rather than switching on getOption directly.
The parameter matching regex had spaces added to it in pull request #110
that caused arguments of the format foo=bar to not be matched correctly,
so no parameters were actually being passed to the underlying api
method. The spaces were removed from the regex and the parsing worked.
Two other regex matches had spaces added to them by pull request #110
that I have not touched, but they seem suspect.