Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions when submitting a form which is supposed to save to a spreadsheet #2238

Closed
nikkilocke opened this issue Jul 8, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@nikkilocke
Copy link

Describe the bug
When a user is filling in some forms, when they submit the form, they get an error message. The form is set to save the data to a spreadsheet. The data in the form is updated, but the spreadsheet isn't.

To Reproduce
Try to submit a form.

Expected behaviour
The form is submitted and the spreadsheet updated.

Nextcloud (please complete the following information):

  • Nextcloud-Version: 28.0.7
  • Forms-Version: 4.2.4

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 126.0.6478.127 (Official Build) (64-bit)

Additional context
The Nextcloud log shows the following:

Exception
OC\Files\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/lib/private/Files/View.php on line 528 in file '/var/www/html/lib/private/Files/View.php' line 1128
/var/www/html/lib/private/AppFramework/App.php
line 184
OC\AppFramework\Http\Dispatcher->dispatch(
  [
    "OCA\\Forms\\Controller\\ApiController"
  ],
  "insertSubmission"
)
/var/www/html/lib/private/Route/Router.php
line 315
OC\AppFramework\App::main(
  "OCA\\Forms\\Controller\\ApiController",
  "insertSubmission",
  [
    "OC\\AppFramework\\DependencyInjection\\DIContainer"
  ],
  [
    "v2.4",
    "ocs.forms.api.insertSubmission"
  ]
)
/var/www/html/ocs/v1.php
line 65
OC\Route\Router->match(
  "/ocsapp/apps/forms/api/v2.4/submission/insert"
)
/var/www/html/ocs/v2.php
line 23
undefinedundefinedrequire_once(
  "/var/www/html/ocs/v1.php"
)
Caused by TypeError
OC\Files\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/lib/private/Files/View.php on line 528
Raw log entry
{
  "reqId": "tK7bAR19VERXEWlDhQh6",
  "level": 3,
  "time": "2024-07-08T15:01:21+00:00",
  "remoteAddr": "91.196.221.60",
  "user": "nedevans",
  "app": "no app in context",
  "method": "POST",
  "url": "/ocs/v2.php/apps/forms/api/v2.4/submission/insert",
  "message": "Exception thrown: Exception",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
  "version": "28.0.6.1",
  "exception": {
    "Exception": "Exception",
    "Message": "OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/lib/private/Files/View.php on line 528 in file '/var/www/html/lib/private/Files/View.php' line 1128",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Forms\\Controller\\ApiController"
          ],
          "insertSubmission"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Forms\\Controller\\ApiController",
          "insertSubmission",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "v2.4",
            "ocs.forms.api.insertSubmission"
          ]
        ]
      },
      {
        "file": "/var/www/html/ocs/v1.php",
        "line": 65,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/apps/forms/api/v2.4/submission/insert"
        ]
      },
      {
        "file": "/var/www/html/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/html/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 169,
    "Previous": {
      "Exception": "TypeError",
      "Message": "OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/lib/private/Files/View.php on line 528",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 528,
          "function": "basicOperation",
          "class": "OC\\Files\\View",
          "type": "->",
          "args": [
            "file_exists",
            null
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/Filesystem.php",
          "line": 545,
          "function": "file_exists",
          "class": "OC\\Files\\View",
          "type": "->",
          "args": [
            null
          ]
        },
        {
          "file": "/var/www/html/apps/files_versions/lib/Storage.php",
          "line": 190,
          "function": "file_exists",
          "class": "OC\\Files\\Filesystem",
          "type": "::",
          "args": [
            null
          ]
        },
        {
          "file": "/var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php",
          "line": 196,
          "function": "store",
          "class": "OCA\\Files_Versions\\Storage",
          "type": "::",
          "args": [
            null
          ]
        },
        {
          "file": "/var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php",
          "line": 102,
          "function": "write_hook",
          "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
          "type": "->",
          "args": [
            [
              "OC\\Files\\Node\\File"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
          "line": 86,
          "function": "handle",
          "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
          "type": "->",
          "args": [
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 230,
          "function": "__invoke",
          "class": "OC\\EventDispatcher\\ServiceEventListener",
          "type": "->",
          "args": [
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ],
            "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent",
            [
              "Symfony\\Component\\EventDispatcher\\EventDispatcher"
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
          "line": 59,
          "function": "callListeners",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              [
                "Closure"
              ],
              [
                "Closure"
              ]
            ],
            "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent",
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 94,
          "function": "dispatch",
          "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ],
            "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
          ]
        },
        {
          "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
          "line": 106,
          "function": "dispatch",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent",
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/Node/HookConnector.php",
          "line": 100,
          "function": "dispatchTyped",
          "class": "OC\\EventDispatcher\\EventDispatcher",
          "type": "->",
          "args": [
            [
              "OCP\\Files\\Events\\Node\\BeforeNodeWrittenEvent"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/legacy/OC_Hook.php",
          "line": 105,
          "function": "write",
          "class": "OC\\Files\\Node\\HookConnector",
          "type": "->",
          "args": [
            [
              true,
              "/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 1272,
          "function": "emit",
          "class": "OC_Hook",
          "type": "::",
          "args": [
            "OC_Filesystem",
            "write",
            [
              true,
              "/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx"
            ]
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 1144,
          "function": "runHooks",
          "class": "OC\\Files\\View",
          "type": "->",
          "args": [
            [
              "update",
              "write"
            ],
            "/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx"
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/View.php",
          "line": 680,
          "function": "basicOperation",
          "class": "OC\\Files\\View",
          "type": "->",
          "args": [
            "file_put_contents",
            "/markstock/files/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx",
            [
              "update",
              "write"
            ],
            null
          ]
        },
        {
          "file": "/var/www/html/lib/private/Files/Node/File.php",
          "line": 73,
          "function": "file_put_contents",
          "class": "OC\\Files\\View",
          "type": "->",
          "args": [
            "/markstock/files/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx",
            null
          ]
        },
        {
          "file": "/var/www/html/custom_apps/forms/lib/Service/SubmissionService.php",
          "line": 224,
          "function": "putContent",
          "class": "OC\\Files\\Node\\File",
          "type": "->",
          "args": [
            null
          ]
        },
        {
          "file": "/var/www/html/custom_apps/forms/lib/Controller/ApiController.php",
          "line": 1145,
          "function": "writeFileToCloud",
          "class": "OCA\\Forms\\Service\\SubmissionService",
          "type": "->",
          "args": [
            [
              "OCA\\Forms\\Db\\Form",
              246
            ],
            "/Anchor North [rwg]/Forms/Travel Subsidy Request Form.xlsx",
            "xlsx",
            "markstock"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 230,
          "function": "insertSubmission",
          "class": "OCA\\Forms\\Controller\\ApiController",
          "type": "->",
          "args": [
            246,
            [
              [
                "1196"
              ],
              [
                "Ned Evans"
              ],
              [
                "xxx"
              ],
              [
                "2024-07-27"
              ],
              [
                1226
              ],
              "And 12 more entries, set log level to debug to see all entries"
            ],
            "Et49ztRP6TNQT8Qm932qRwcJ"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 137,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\Forms\\Controller\\ApiController"
            ],
            "insertSubmission"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/App.php",
          "line": 184,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\Forms\\Controller\\ApiController"
            ],
            "insertSubmission"
          ]
        },
        {
          "file": "/var/www/html/lib/private/Route/Router.php",
          "line": 315,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OCA\\Forms\\Controller\\ApiController",
            "insertSubmission",
            [
              "OC\\AppFramework\\DependencyInjection\\DIContainer"
            ],
            [
              "v2.4",
              "ocs.forms.api.insertSubmission"
            ]
          ]
        },
        {
          "file": "/var/www/html/ocs/v1.php",
          "line": 65,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/ocsapp/apps/forms/api/v2.4/submission/insert"
          ]
        },
        {
          "file": "/var/www/html/ocs/v2.php",
          "line": 23,
          "args": [
            "/var/www/html/ocs/v1.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/var/www/html/lib/private/Files/View.php",
      "Line": 1128
    },
    "CustomMessage": "Exception thrown: Exception"
  },
  "id": "668c0c4c6935a"
}
@nikkilocke nikkilocke added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Jul 8, 2024
@Chartman123
Copy link
Collaborator

Duplicate of #2067

@Chartman123 Chartman123 marked this as a duplicate of #2067 Jul 8, 2024
@Chartman123 Chartman123 added duplicate This issue or pull request already exists and removed bug Something isn't working 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Jul 8, 2024
@Chartman123 Chartman123 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants