MejorServer Posted June 2, 2015 Share Posted June 2, 2015 To post remove: style="visibility: hidden; width: 0px; min-width: 0px; display: none;" I updated but the updateclientproduct function from api is broken! I fixed it using the file: updateclientproduct.php from 5.3.13. I don't know if there is another error. Please check out the patches before release. Link to comment Share on other sites More sharing options...
Alex - Arvixe Posted June 3, 2015 Share Posted June 3, 2015 Hopefully they issue a patch for that though I doubt many would refrain from upgrading to 5.3.14 considering it is a security release and most wouldn't use the API. Link to comment Share on other sites More sharing options...
SeanP Posted June 3, 2015 Share Posted June 3, 2015 I am running 5.3.14, and the updateclientproduct API function is working for me. At least the external API for that function appears to work. Exactly what is not working for you, and are you using the Internal or External API? Link to comment Share on other sites More sharing options...
MejorServer Posted June 3, 2015 Author Share Posted June 3, 2015 Internal API, and customfields modification Link to comment Share on other sites More sharing options...
WHMCS Nate Posted June 3, 2015 Share Posted June 3, 2015 Hello, Can you post / pm me some example code that is working in 5.3.13 but not working in 5.3.14 so we can investigate this further. Thanks very much, Nate C Link to comment Share on other sites More sharing options...
SeanP Posted June 3, 2015 Share Posted June 3, 2015 I am using the external API, with custom fields modification, and it appears to work fine. However, I haven't checked it using the internal API. Link to comment Share on other sites More sharing options...
MejorServer Posted June 3, 2015 Author Share Posted June 3, 2015 $values['serviceid']=333; $values['customfields']=base64_encode(serialize(['44'=>'blah')); $command='updateclientproduct'; $results=localAPI($command,$values,1); the results is 'success', but no change on the custom field are stored. Link to comment Share on other sites More sharing options...
WHMCS Nate Posted June 3, 2015 Share Posted June 3, 2015 Hello, There is a slight typo in your code example. You don't have a closing brace after 'blah'. However with that fixed I was able to make this work without issue. I placed the code in an addClient hook: function create_forum_account($vars) { $values['serviceid']=2; $values['customfields']=base64_encode(serialize(['1'=>'5'])); $command='updateclientproduct'; $results=localAPI($command,$values,1); die(print_r($results)); // Run code to create remote forum account here... } add_hook("ClientAdd",1,"create_forum_account"); It returned success and changed the file. If the missing bracket is not in your actual production code and you are still experiencing trouble, please open a support ticket so we can investigate the particular installation more deeply. Thanks very much, Nate C Link to comment Share on other sites More sharing options...
MejorServer Posted June 4, 2015 Author Share Posted June 4, 2015 I created the support ticket. Maybe you just call the function from a server module like I do. Also is that the best way to update customfields from a server module? Or should i doit directly using a sql query? Link to comment Share on other sites More sharing options...
WHMCS Nate Posted June 5, 2015 Share Posted June 5, 2015 In the support ticket we were able to reproduce this issue. It effects API calls that require arrays being serialized to be passed in. If the serialized string is longer then 4096 chars it was hitting some new input validation we introduced. I have opened CORE-8549 to track the improvements to this input validation. Thanks to MejorServer for reporting the issue and to everyone else who helped to narrow down the issue. Nate C Link to comment Share on other sites More sharing options...
Recommended Posts