Jump to content

Bug in api.php preventing Document upload via API. Fix included.


barryf

Recommended Posts

Hi,

Using version 5.3.2 we ran into an issue when trying to upload Documents via the API.

The error returned was:

[2022-04-26T20:20:34.080621+00:00] general.ERROR: Uncaught Exception ArgumentCountError: "Too few arguments to function ClientDocumentsFiles::add(), 0 passed in /var/www/blesta/app/controllers/api.php on line 154 and exactly 2 expected" at /var/www/blesta/plugins/client_documents/models/client_documents_files.php line 33 {"exception":"[object] (ArgumentCountError(code: 0): Too few arguments to function ClientDocumentsFiles::add(), 0 passed in /var/www/blesta/app/controllers/api.php on line 154 and exactly 2 expected at /var/www/blesta/plugins/client_documents/models/client_documents_files.php:33)"}

The fix was to add the following two lines in app/controllers/api.php
 

$ diff  app/controllers/api.php /var/www/blesta/app/controllers/api.php

150a151,153
>           if( $this->files )
>               $params['files'] = $this->files;
>

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...