nextcloud / polls

🗳️ Polls app for Nextcloud
https://apps.nextcloud.com/apps/polls
GNU Affero General Public License v3.0
256 stars 73 forks source link

Error adding new poll option (TypeError: Return value of OCA\Polls\Db\Option::getDisplayName() must be of the type string, null returned) #2126

Closed fuse314 closed 2 years ago

fuse314 commented 2 years ago

What is going wrong? What did you observe?

When I add a date to a (test) poll I receive the following error:

Steps to reproduce the behavior

  1. New Nextcloud instance
  2. Add polls App
  3. Create new poll with dates
  4. Add a few date options

image

If applicable, add screenshots to help explain your problem.

How should it work?

Date option should be added without error

Information about your polls installation

Polls version: 3.4.0

Fresh installation or update from a prior version (from which one)?

How did you install this version?(Appstore or describe installation)

Information about your Instance of Nextcloud

Nextcloud version: 21.0.7

List of activated apps ``` Enabled: - activity: 2.14.3 - apporder: 0.13.0 - bookmarks: 10.0.3 - calendar: 3.0.1 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contacts: 4.0.6 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.17.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_markdown: 2.3.5 - files_pdfviewer: 2.1.1 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - notes: 4.2.0 - notifications: 2.9.0 - oauth2: 1.9.0 - password_policy: 1.11.0 - passwords: 2021.11.20 - phonetrack: 0.6.9 - photos: 1.3.0 - polls: 3.4.0 - previewgenerator: 3.4.0 - privacy: 1.5.0 - provisioning_api: 1.11.0 - recommendations: 1.0.0 - richdocuments: 4.2.3 - settings: 1.3.0 - sharebymail: 1.11.0 - systemtags: 1.11.0 - tasks: 0.14.2 - text: 3.2.0 - theming: 1.12.0 - theming_customcss: 1.10.0 - twofactor_backupcodes: 1.10.0 - twofactor_totp: 6.2.0 - twofactor_u2f: 6.3.0 - twofactor_webauthn: 0.2.14 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.1 Disabled: - accessibility - admin_audit - encryption - files_external - firstrunwizard - nextcloud_announcements - serverinfo - support - survey_client - updatenotification - user_ldap - user_status ```
Nextcloud Configuration ``` { "system": { "memcache.local": "\\OC\\Memcache\\APCu", "apps_paths": [ { "path": "\/var\/www\/html\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/www\/html\/custom_apps", "url": "\/custom_apps", "writable": true } ], "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "***DOMAIN***" ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "overwriteprotocol": "https", "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\HEIC", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\MSOffice2003", "OC\\Preview\\MSOffice2007", "OC\\Preview\\MSOfficeDoc", "OC\\Preview\\OpenDocument", "OC\\Preview\\Movie" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "21.0.7.0", "overwrite.cli.url": "http:\/\/localhost", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "simpleSignUpLink.shown": false, "default_phone_region": "***COUNTRY***", "maintenance": false, "loglevel": 0, "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379 }, "theme": "" } } ```

Server configuration (decide, if you think it is helpful)

Database:

PHP version:

Are you using an external user-backend, if yes which one: no.

Client configuration

Device:

Browser:

Logs

Nextcloud log ``` [index] Error: TypeError: Return value of OCA\Polls\Db\Option::getDisplayName() must be of the type string, null returned at <> 0. /var/www/html/custom_apps/polls/lib/Db/Option.php line 116 OCA\Polls\Db\Option->getDisplayName() 1. <> OCA\Polls\Db\Option->jsonSerialize() 2. /var/www/html/lib/public/AppFramework/Http/JSONResponse.php line 73 json_encode({option: OCA\Pol ... }}, 1) 3. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 172 OCP\AppFramework\Http\JSONResponse->render() 4. /var/www/html/lib/private/AppFramework/App.php line 157 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Polls\Controller\OptionController {}, "add") 5. /var/www/html/lib/private/Route/Router.php line 303 OC\AppFramework\App::main("OCA\\Polls\\Con ... r", "add", OC\AppFramework\ ... {}, {_route: "polls.option.add"}) 6. /var/www/html/lib/base.php line 993 OC\Route\Router->match("/apps/polls/option") 7. /var/www/html/index.php line 37 OC::handleRequest() POST /apps/polls/option from xx.xx.xx.xx by xx at 2021-12-07T15:51:10+00:00 ```
Browser console log ``` /apps/polls/option:1 Failed to load resource: the server responded with a status of 500 () polls.js?v=20b34bc4-7:2 Error adding option: ```
Other browser logs ``` Insert additional logs from your browser here ```
github-actions[bot] commented 5 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.