Hello everyone
I coded an app for nextcloud and it depends on the Groupfolders app.
I coded with Nextcloud 21 with PHP 7.4 and it worked.
When I install with PHP7.3 and Nextcloud 20 or 21. I get this error message from nextcloud.log :
{
"reqId":"uFaMt4OIsZlcpqsJXOSL",
"level":3,
"time":"2021-11-17T14:14:12+00:00",
"remoteAddr":"172.19.0.1",
"user":"admin",
"app":"index",
"method":"GET",
"url":"/apps/workspace/spaces",
"message":{
"Exception":"TypeError",
"Message":"Return value of OC\\AppFramework\\Middleware\\MiddlewareDispatcher::afterException() must be an instance of OCP\\AppFramework\\Http\\Response, null returned",
"Code":0,
"Trace":[
{
"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line":108,
"function":"afterException",
"class":"OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
"type":"->",
"args":[
{
"__class__":"OCA\\Workspace\\Controller\\WorkspaceController"
},
"findAll",
{
"__class__":"OCP\\Http\\Client\\LocalServerException"
}
]
},
{
"file":"/var/www/html/lib/private/AppFramework/App.php",
"line":152,
"function":"dispatch",
"class":"OC\\AppFramework\\Http\\Dispatcher",
"type":"->",
"args":[
{
"__class__":"OCA\\Workspace\\Controller\\WorkspaceController"
},
"findAll"
]
},
{
"file":"/var/www/html/lib/private/Route/Router.php",
"line":309,
"function":"main",
"class":"OC\\AppFramework\\App",
"type":"::",
"args":[
"OCA\\Workspace\\Controller\\WorkspaceController",
"findAll",
{
"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route":"workspace.workspace.findAll"
}
]
},
{
"file":"/var/www/html/lib/base.php",
"line":1008,
"function":"match",
"class":"OC\\Route\\Router",
"type":"->",
"args":[
"/apps/workspace/spaces"
]
},
{
"file":"/var/www/html/index.php",
"line":37,
"function":"handleRequest",
"class":"OC",
"type":"::",
"args":[
]
}
],
"File":"/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
"Line":122,
"CustomMessage":"--"
},
"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0",
"version":"20.0.14.2"
}
I think the problem is in this function :
<?php
// GroupfolderService.php
public function getAll() {
$response = $this->httpClient->get(
$this->urlGenerator->getBaseUrl() . '/index.php/apps/groupfolders/folders',
[
'auth' => [
$this->login->getUID(),
$this->login->getPassword()
],
'headers' => self::HEADERS
]
);
$response = json_decode($response->getBody(), true);
return $response['ocs']['data'];
}
The problem is in line with $response = $this->httpClient->get()
… $this->httpClient
is the IClient Interface.
Do you have one idea of this problem ?
Thank you in advance