Open elburro1887 opened 1 year ago
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response form the developers so far.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
The workaround here is to remove the following line
Here is a patch file for v5.3.0
that was generated using https://github.com/symplify/vendor-patches
--- /dev/null
+++ ../src/Rest/Base.php
@@ -177,7 +177,6 @@
$client = new Rest($session->getShop(), $session->getAccessToken());
- $params = array_filter($params);
switch ($httpMethod) {
case "get":
$response = $client->get(
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Is this issue solved? there has been no response from the developers so far.
Hey, sorry for the delay in responding here. The stalebot was removed, but the issue wasn't addressed yet.
I've added it to our tracking now so we can follow it more closely, and we will look into fixing it.
Thank you for your patience on this one!
Issue summary
In
Base.php
, in therequest()
function, there is a call toarray_filter($params)
.https://github.com/Shopify/shopify-api-php/blob/b26b415b7dcdf7daf61e4b3b622ea64e30a8a916/src/Rest/Base.php#L178
If we send a payload where one of the request payload values is 0, (such as we want to set the inventory level of a product to 0, the call to
array_filter()
removes the entire value where 0 is set from the payload array, and thus the API will respond that the value is missing.Expected behavior
The value containing 0 should be passed to the API request and not be removed from the request payload.
Actual behavior
The request parameter containing a "0" gets removed and we receive an error, such as:
EXCEPTION encountered! REST request failed: {"available":"Required parameter missing or invalid"}
Steps to reproduce the problem
Send the following request:
The call will return with the following error:
EXCEPTION encountered! REST request failed: {"available":"Required parameter missing or invalid"}
When setting
available
to any value > 0, we will get a successful response