Polls: [1.0-beta3] Add error handling for contacts

Created on 11 Jan 2020  ·  16Comments  ·  Source: nextcloud/polls

Also I have a problem when I try to add some recipient:

[PHP] Error: Undefined index: ORG at /var/www/nextcloud/apps/polls/lib/Controller/SystemController.php#168 POST /index.php/apps/polls/siteusers/get/
from 192.168.0.254 by olivier at 2020-01-10T19:05:18+00:00

[PHP] Error: Undefined index: PHOTO at /var/www/nextcloud/apps/polls/lib/Controller/SystemController.php#174 POST /index.php/apps/polls/siteusers/get/
from 192.168.0.254 by olivier at 2020-01-10T19:05:18+00:00

[PHP] Error: Undefined index: userEmail at /var/www/nextcloud/apps/polls/lib/Controller/ShareController.php#156 POST /index.php/apps/polls/share/write/
from 192.168.0.254 by olivier at 2020-01-10T19:30:07+00:00

And I have the same kind of error when I try to create a public link...
and I can't share the poll with anybody...

_Originally posted by @leolivier in https://github.com/nextcloud/polls/issues/706#issuecomment-573174356_

bug

Most helpful comment

Seems I messed up some things. Will fix it after some reviews. Update will come tonight.

All 16 comments

I am still getting Undefined index: userEmail when pulically sharing a poll with the stable release.

I've the same problem too. We cant use this app...
Please fix it and create a new release to make this app useable.
Thanks!

Nextcloud 18 (fresh installation) on Ubuntu 18 with PHP 7.2
Poll: 1.0.0

Error if I share my poll:

Undefined index: userEmail at /var/www/html/apps/polls/lib/Controller/ShareController.php#156

First of all - great app - but same problem here, if I try to share with users, contacts or create a public link:

Undefined index: userEmail at /var/www/html/custom_apps/polls/lib/Controller/ShareController.php#156

  • Nextcloud 17.0.2 (stable)
  • PHP 7.3
  • App version 1.0.0.

Would be great, if this will be fixed fast. Thanks!

Is fixed, but release is pending. Stay tuned for Version 1.1.
I will publish a pre-release this evening for manual install.

You can try the pre-release. Appstore release will be the same just with an updated version number.

❗️ I was to fast. Seems the problem still exists. I have to look after it again.

Please give feedback, if this works now.

I think I am doing something wrong as I manually applied https://github.com/nextcloud/polls/commit/84e4f8b78085c04378e2a26b912a1a824db2c9cf. Now there is no more error in the PHP or Nextcloud log.
But I still can't pulically share a poll the request still returns a 409 Conflict.
POST parameters are {"pollId":14,"share":{"type":"public","userId":"","pollId":14,"token":""}}, response is {}

In case it helps: I removed the catch below:
https://github.com/nextcloud/polls/blob/84e4f8b78085c04378e2a26b912a1a824db2c9cf/lib/Controller/ShareController.php#L173-L175

And now this error popped up in my Sentry instance:

An exception occurred while executing 'INSERT INTO `oc_polls_share` (`type`, `poll_id`, `user_id`, `user_email`, `token`) VALUES(?, ?, ?, ?, ?)' with params ["public", 14, "", "", "GN4e1WT24Rm1kRjP"]:

SQLSTATE[HY000]: General error: 1364 Field 'user' doesn't have a default value

It seems like it is intentional that user_id is empty:
https://github.com/nextcloud/polls/blob/f7e81b01ed5ebc4523d9c5c67e1551d13304a200/src/js/components/SideBar/SideBarTabShare.vue#L80

Seems I messed up some things. Will fix it after some reviews. Update will come tonight.

In case it helps: This is my database.
grafik

Strange, that user defaults to null. The migration says default = ''.
But the column seems to be filled with ''

But the column seems to be filled with ''

Guess that's because "null" is not allowed for user ("Null" -> "NO").

We use NextCloud with LDAP. The Usernames are like S-1-63737283873-7374838-83747 and not the name of a user like „John Doe“ e.g.
Maybe that is a problem? In all other apps the names are correct loaded 🙂

We should use the users "display name" where possible not the "username".

Seems to be related to #771
@Dennis1993 @RainerEmrich see #715

Symtoms were the same as in #771. Should be finally fixed with #778

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dartcafe picture dartcafe  ·  3Comments

amittel picture amittel  ·  5Comments

johnnydvc picture johnnydvc  ·  6Comments

nextgen-networks picture nextgen-networks  ·  6Comments

rubo77 picture rubo77  ·  4Comments