I follow the tutorial to write my own nextcloud app. First of all, everything used to work once in owncloud, before I tried to migrate to nextcloud. What I see is, that the tutorial is completely broken and not even the tutorial app does work!
Here is my current problem:
<?php
namespace OCA\GgrWinti\Controller;
use Exception;
use OCP\IRequest;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCA\GgrWinti\Db\Geschaeft;
use OCA\GgrWinti\Db\GeschaeftMapper;
class GeschaeftController extends Controller {
private $mapper;
private $userId;
public function __construct($AppName, IRequest $request, GeschaeftMapper $hereismapper, $UserId){
parent::__construct($AppName, $request);
$this->mapper = $hereismapper;
$this->userId = $UserId;
}
[...]
Results in:
Interner Serverfehler
Der Server hat einen internen Fehler und konnte Ihre Anfrage nicht vervollständigen.
Bitte wende dich an den Serveradministrator, falls dieser Fehler mehrfach auftritt, und füge deiner Anfrage die untenstehenden technischen Details bei.
Weitere Details können im Serverprotokoll gefunden werden.
Technische Details
Entfernte Adresse: 172.21.42.1
Anforderungskennung: EMaOtyA3EVgcq8ODr9oq
Typ: OCP\AppFramework\QueryException
Code: 0
Nachricht: Could not resolve hereismapper! Class hereismapper does not exist
Datei: /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php
Zeile: 102
Spur
#0 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): OC\AppFramework\Utility\SimpleContainer->resolve('hereismapper')
#1 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(544): OC\AppFramework\Utility\SimpleContainer->query('hereismapper')
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(73): OC\AppFramework\DependencyInjection\DIContainer->query('hereismapper')
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(96): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\GgrWinti\\Co...')
#5 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(544): OC\AppFramework\Utility\SimpleContainer->query('OCA\\GgrWinti\\Co...')
#6 /var/www/nextcloud/lib/private/AppFramework/App.php(101): OC\AppFramework\DependencyInjection\DIContainer->query('OCA\\GgrWinti\\Co...')
#7 /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main('OCA\\GgrWinti\\Co...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#8 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
#9 /var/www/nextcloud/lib/private/Route/Router.php(299): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
#10 /var/www/nextcloud/lib/base.php(1010): OC\Route\Router->match('/apps/ggrwinti/...')
#11 /var/www/nextcloud/index.php(40): OC::handleRequest()
#12 {main}
It wants to resolve the Variable-Name! That’s crazy.
I even downgraded from NC12 to NC11 because of known bugs in NC12.
Source code is at: https://github.com/mwaeckerlin/ggrwinti
Execute ./bootstrap.sh -a
to build, then copy directory html
to apps/ggrwinti
.
I have docker container, so you can easily test my app:
docker run -d --name ggrwinti-mysql -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=ert456 -e MYSQL_RANDOM_ROOT_PASSWORD=1 mysql
docker run -d --name ggrwinti -p 9000:80 -e ADMIN_PWD=ert456 --link ggrwinti-mysql:mysql mwaeckerlin/ggrwinti
docker logs -f ggrwinti
As soon as apache started, head your browser to http://localhost:9000
and login with admin
and ert456
. Click on one of the two (why two?) GGR-Winti apps, then click on «Geschäfte» in the navigation.
→ You see the problem.