API does not work after Update to 2.6
-
- Posts: 85
- Joined: 13 Feb 2018, 20:45
- Name: Joachim Suehlo
- Location: Germany Hannover
- Company Name: b-prisma
API does not work after Update to 2.6
API does not work after Update to 2.6.
I have 2 installations on the same website:
With 2.5 API still works, with 2.6 not.
I have 2 installations on the same website:
With 2.5 API still works, with 2.6 not.
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: API does not work after Update to 2.6
Can't reproduce it. What do you mean "Not work". Any error messages or something like this?
Which api action do you use (insert/update/select)?
Which api action do you use (insert/update/select)?
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: API does not work after Update to 2.6
Please add to your code next line so we will see full response. (see attached screenshot)
-
- Posts: 85
- Joined: 13 Feb 2018, 20:45
- Name: Joachim Suehlo
- Location: Germany Hannover
- Company Name: b-prisma
Re: API does not work after Update to 2.6
I did this:
And got this result:
But the output still is missing.
The scripts are absolutely identical for the old and the new ruko version except the URL of the rest.php.
Code: Select all
if($result)
{
$result = json_decode($result,true);
print_r($result); ...
}
Code: Select all
Array ( [status] => success [data] => Array ( [0] => Array ( [id] => 1 [parent_item_id] => 5 [date_added] => 04.04.2018 14:35 [created_by] => Jochen ...
The scripts are absolutely identical for the old and the new ruko version except the URL of the rest.php.
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: API does not work after Update to 2.6
Check fields ID and check your code.
-
- Posts: 85
- Joined: 13 Feb 2018, 20:45
- Name: Joachim Suehlo
- Location: Germany Hannover
- Company Name: b-prisma
Re: API does not work after Update to 2.6
I checked my code and did not find anything.
Then I compared the print output with ruko 2.5 and 2.6, see image:
Then I replaced the file "../plugins/ext/classes/api.php" from version 2.6 with the one from 2.5.
And now it works as before and the print output is identical.
Please check, what the reasons for this could be.
Then I compared the print output with ruko 2.5 and 2.6, see image:
Then I replaced the file "../plugins/ext/classes/api.php" from version 2.6 with the one from 2.5.
And now it works as before and the print output is identical.
Please check, what the reasons for this could be.
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: API does not work after Update to 2.6
There are two differences:
1) added parent_item_id to result. This is change nothing.
2) attachment file name now include time when it's added (at the start of file). It's like it's stored in database.
So this is might your issue. If you don't need it, you can exclude time from filename.
1) added parent_item_id to result. This is change nothing.
2) attachment file name now include time when it's added (at the start of file). It's like it's stored in database.
So this is might your issue. If you don't need it, you can exclude time from filename.
-
- Posts: 85
- Joined: 13 Feb 2018, 20:45
- Name: Joachim Suehlo
- Location: Germany Hannover
- Company Name: b-prisma
Re: API does not work after Update to 2.6
Yes, it must be the filename. When I got in other cases not the correct filename, e.g. file-ending is missing, then there is nothing shown.
But how can I exclude time from filename?
But how can I exclude time from filename?
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: API does not work after Update to 2.6
Simple use substr function. Example:
Code: Select all
$filename = '123123123_some_file_nqme.gsm';
echo substr($filename,strpos($filename,'_')+1);
-
- Posts: 85
- Joined: 13 Feb 2018, 20:45
- Name: Joachim Suehlo
- Location: Germany Hannover
- Company Name: b-prisma
Re: API does not work after Update to 2.6
Thank You much: that works well.