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

Internal server error when public link is used #178

Closed
githubDante opened this issue Jan 21, 2020 · 2 comments
Closed

Internal server error when public link is used #178

githubDante opened this issue Jan 21, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@githubDante
Copy link

Which Forms version are you running? (see apps page)
git [master] - see #166 why
Nextcloud or ownCloud?:
Nextcloud
Nextcloud/ownCloud version: (see Nextcloud admin page)
17.0.2

Steps to reproduce

  1. Create a form, set the access type to Public.
  2. Open the form link from private window.

Actual behaviour

Internal server error.

Expected behaviour

The link should provide access to the form.

Logs

  • Log from the admin panel:
[index] Error: Exception: Argument 2 passed to OCA\Forms\Db\NotificationMapper::findByUserAndForm() must be of the type string, null given, called in
<removed>/apps/forms/lib/Controller/PageController.php on line 281 at <<closure>>

0. <removed>/lib/private/AppFramework/App.php line 126
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Forms\Controller\PageController {}, "gotoForm")
1. <removed>/lib/private/AppFramework/oRuting/RouteActionHandler.php line 47
   OC\AppFramework\App::main("OCA\\Forms\\Controller\\PageController", "gotoForm", OC\AppFramework\ ... {}, {hash: "2tk0hQCg     ... "})
2. <<closure>>
   OC\AppFramework\Routing\RouteActionHandler->__invoke({hash: "2tk0hQCg ... "})
3. <removed>/lib/private/Route/Router.php line 297
   undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {hash: "2tk0hQCg ... "})
4. <removed>/lib/base.php line 997
   OC\Route\Router->match("/apps/forms/form/2tk0hQCgNLExJ9xK")
5. <removed>/index.php line 42
   OC::handleRequest()
GET /index.php/apps/forms/form/2tk0hQCgNLExJ9xK

Reason

userID will remain null in the scenario described above, which in turn causes the reported error.

Fix

The following patch contains a fix.

PageController_notifMapper_patch.txt

githubDante added a commit to githubDante/forms that referenced this issue Feb 12, 2020
Additionally will use the IP address from the request if the form
is not Anonymous and the user is not lgged in. See nextcloud#179
githubDante added a commit to githubDante/forms that referenced this issue Feb 12, 2020
Additionally will use the IP address from the request if the form
is not Anonymous and the user is not lgged in. See nextcloud#179

Signed-off-by: githubDante <github@dante.tk>
githubDante added a commit to githubDante/forms that referenced this issue Feb 24, 2020
Additionally will use the IP address from the request if the form
is not Anonymous and the user is not lgged in. See nextcloud#179

Signed-off-by: githubDante <github@dante.tk>
@schniepp
Copy link

schniepp commented Mar 9, 2020

Worked for me! Hope this will get merged! For 1.1.2?

@jotoeri
Copy link
Member

jotoeri commented Mar 20, 2020

Solved with #235 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants