-
Notifications
You must be signed in to change notification settings - Fork 252
Undefined index: Content-Type in LogAPIResponseToLog #236
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
Comments
It's strange. Can you please make sure that you have single LogAPIResponseToLog function? I'm using the latest version of SDK but on my end, i have already another LogAPIRequestToLog() function on line 296. |
You're correct, it works now. I replaced the second of the two functions. It works replacing the first only. |
Glad it worked! Note that one you replaced is a Respond and another is Request. If you're more familiar with the native library, please do check this moment:
Thanks for the support. |
I'm getting same issue with version 5.0 itself. |
I have the same issue with the 5.0.4 version. I don't see the duplicate function mentioned above. Editing the function as mentioned by @kirill-mally fixes the issue. Thanks. |
I have upgraded to 5.0.4 version but didn't find the duplicate function. Tried @kirill-mally solution and its works but modifying core files is not a solution. |
@tariqwiztech I'm not aware of how to add the fix to the core function and commit it here. That's why it will be nice if maybe @hlu2 could note about the problem. |
Hi - Can one of you please provide the company id for which you are getting the incorrect headers? |
@diana-derose For us it's the Eljin Productions Inc. company. I believe that problem lies in what fields or params were used in DataService object creation.
But the problem persisted on the OAuth authentication process. I've got a respond from @hlu2:
|
I am just using sandbox for development and it is happening there. It is happening when I try to create an invoice or even when trying to connect. |
thanks @kirill-mally and @virendrachandak for additional details. Unfortunately, we are not able to reproduce this on our end but @hlu2 will add the fix now so all of you are unblocked. |
Thanks @diana-derose and thanks @hlu2 once again for a rapid response. |
Fixed. |
Thanks @hlu2. Its fixed now :) |
Fix the intuit#237 and intuit#236
At some point, begin getting error notice about Undefined index: Content-Type in HttpClients/SyncRestHandler.php.
Environment:
Root of the problem is in incorrect cast of the constant Content-Type variable.
I'm not sure whether it depends on the PHP settings or cast conversion has to be done manually but had to add fix on my end to proceed.
So, when the strings compare was made, we are calling the array item but with capitalized letters. Firstly, I had to transform characters into lowercase to match the corresponding array key. Secondly, cover the whole piece of code into try-catch logic for not letting Exception outside and ruining the respond.
Comment on this case and if it makes sense and worth adding to the next release, please do it. I'm worried that after another composer update my edits will be lost.
Thanks.
The text was updated successfully, but these errors were encountered: