Skip to content

Can't add a new tile server

I'm trying to add a new tile server, but I'm getting an error "Failed to add tile server 'MyServer'".

Steps to reproduce:

  1. Open GpxPod inside the nextcloud instance.
  2. Click the "Settings and extra actions" button on the side panel
  3. Click the "Custom tile server" tab
  4. Add the following data:
Server name: MyServer
Server url: https://bgmtile.kade.si/{z}/{x}/{y}.png
Min zoom: 4
Max zoom: 19
  1. Click "Add" buton

Expected behavior: the tile server is added to the list of custom tile servers.

Current behavior: an error is displayed - "Failed to add tile server 'MyServer'".

Environment:

OS: Debian 10 (Linux 4.19.0-14)
Web Server: Apache 2.4.38
PHP: v7.3.19
Nextcloud: v20.0.8
GpxPod: v4.2.8

When I inspect the nextcloud.log file I see the following exception: Argument 1 passed to OCA\\GpxPod\\Controller\\UtilsController::db_quote_escape_string() must be of the type string, null given, called in /srv/http/nextcloud/apps/gpxpod/lib/Controller/UtilsController.php on line 172

On further inspection, the db_quote_escape_string method in the UtilsController.php has a type hint set to string, but the $token variable is null, when the addTileServer function is called and subsequently db_quote_escape_string.

Changing the type hint to a nullable type seems to fix the issue.