integration_whiteboard icon indicating copy to clipboard operation
integration_whiteboard copied to clipboard

in_array() expects at least 2 parameters, 1 given

Open Derkades opened this issue 4 years ago • 2 comments

Unfortunately I don't have reproduction steps for this, hopefully just the error trace is enough.

[PHP] Error: Error: in_array() expects at least 2 parameters, 1 given at /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php#398 at <<closure>>

0. <<closure>>
   OC\Log\ErrorHandler::onError(2, "in_array() expe ... n", "/var/www/html/a ... p", 398, {user: "*** sens ... }})
1. /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php line 398
   in_array(2523546)
2. /var/www/html/lib/private/User/Manager.php line 610
   OCA\Spacedeck\Service\SpacedeckAPIService->OCA\Spacedeck\Service\{closure}("*** sensitive parameters replaced ***")
3. /var/www/html/apps/integration_whiteboard/lib/Service/SpacedeckAPIService.php line 402
   OC\User\Manager->callForSeenUsers(Closure {})
4. /var/www/html/apps/integration_whiteboard/lib/BackgroundJob/CleanupSpacedeck.php line 72
   OCA\Spacedeck\Service\SpacedeckAPIService->cleanupSpacedeckStorage("http://localhost:9666", "super_secret_token")
5. /var/www/html/lib/public/BackgroundJob/Job.php line 80
   OCA\Spacedeck\BackgroundJob\CleanupSpacedeck->run(null)
6. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 61
   OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
7. /var/www/html/cron.php line 128
   OCP\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

at 2021-02-25T16:15:04+00:00

Derkades avatar Feb 25 '21 16:02 Derkades

running into the same problem. fresh install of nextcloud 21 using docker. only additional installed apps (using the nextcloud-UI):

  • Whiteboard integration version: 0.0.14
  • Splash version: 1.2.2

docker-compose.yml to start nextcloud

i used the template from the nextcloud-docker-example you should be able to reproduce the error using this docker-compose.yml and installing the whiteboard-integration after startup.

version: '3'

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./volumes/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD='MYSQL_ROOT_PW'
      - MYSQL_PASSWORD='MYSQL_PW'
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  nextcloud:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - ./volumes/nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD='MYSQL_PW'
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

changes in my environment: i use traefik as reverse-proxy, redirect http to https and use letsencrypt.
so in my config i removed the ports section an add the following lables for traefik (the domain-name is a environment set outside of the docker-compose.yml)

labels:
      - traefik.enable=true
      - traefik.http.routers.nextcloud.rule=Host(`$NEXTCLOUD_DOMAINNAME`)
      - traefik.http.routers.nextcloud.tls.certresolver=le
      - traefik.http.services.nextcloud.loadbalancer.server.port=80

Errormessage

grafik

Serverinfo in json-format

created by https://<my-nextcloud.example.com>/ocs/v2.php/apps/serverinfo/api/v1/info?format=json info.json.log

tainnok avatar Mar 21 '21 10:03 tainnok

just a guess (as i am no php-developer, and i also do NOT plan to become one):
SpacedeckAPIService.php:398 should be modified as followed?:

398c398
<                               if (!in_array($wbFile->getId())) {
---
>                               if (!in_array($wbFile->getId(), $fileIds)) {

tainnok avatar Mar 21 '21 17:03 tainnok