nextcloud / integration_whiteboard

✏ A whiteboard for Nextcloud, using Spacedeck
https://apps.nextcloud.com/apps/integration_whiteboard
GNU Affero General Public License v3.0
55 stars 7 forks source link

Install error on Nextcloud 21: Undefined constant \"OCA\\Spacedeck\\Service\\GLOB_BRACE\" #28

Open kowalski7cc opened 3 years ago

kowalski7cc commented 3 years ago

Hello, I'm having the following installation error on Nextcloud 21, PHP 8, PostgreSQL 13.2, Nginx on Docker

Trace:

{
    "Exception": "Exception",
    "Message": "Undefined constant \"OCA\\Spacedeck\\Service\\GLOB_BRACE\"",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 993,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/html/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 159,
    "Previous": {
      "Exception": "Error",
      "Message": "Undefined constant \"OCA\\Spacedeck\\Service\\GLOB_BRACE\"",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/html/custom_apps/integration_whiteboard/lib/Service/SpacedeckBundleService.php",
          "line": 203,
          "function": "OCA\\Spacedeck\\Service\\recursiveDelete"
        },
        {
          "file": "/var/www/html/custom_apps/integration_whiteboard/lib/Migration/CopySpacedeckAppData.php",
          "line": 47,
          "function": "copySpacedeckData",
          "class": "OCA\\Spacedeck\\Service\\SpacedeckBundleService",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Repair.php",
          "line": 117,
          "function": "run",
          "class": "OCA\\Spacedeck\\Migration\\CopySpacedeckAppData",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/legacy/OC_App.php",
          "line": 1054,
          "function": "run",
          "class": "OC\\Repair",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Installer.php",
          "line": 166,
          "function": "executeRepairSteps",
          "class": "OC_App",
          "type": "::"
        },
        {
          "file": "/var/www/html/apps/settings/lib/Controller/AppSettingsController.php",
          "line": 448,
          "function": "installApp",
          "class": "OC\\Installer",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 218,
          "function": "enableApps",
          "class": "OCA\\Settings\\Controller\\AppSettingsController",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 127,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/App.php",
          "line": 157,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/html/lib/private/Route/Router.php",
          "line": 302,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/html/lib/base.php",
          "line": 993,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/html/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/html/custom_apps/integration_whiteboard/lib/Service/SpacedeckBundleService.php",
      "Line": 44
    },
    "CustomMessage": "--"
  }
kowalski7cc commented 3 years ago

It seems an error that happens with PHP 8.x, this doesn't happen with PHP 7.4

teutat3s commented 2 years ago

I found a way to get past this error: https://github.com/nextcloud/integration_whiteboard/blob/db64eb10076145e3a64b58900fa36ce8f312494d/lib/Service/SpacedeckBundleService.php#L44

-                $scan = glob(rtrim($str, '/') . '/{,.}*', GLOB_BRACE);
+                $scan = glob(rtrim($str, '/') . '/{,.}*', (defined('GLOB_BRACE') ? GLOB_BRACE : 0));