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

User can't add/suggest dates/entries ("Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int in file 'Entity.php' line 136") #3378

Closed Uatschitchun closed 7 months ago

Uatschitchun commented 7 months ago

⚠️ This issue respects the following points: ⚠️

What went wrong, what did you observe?

Adding a new date-poll (with or without predefined dates) and sharing via public link, a user is not able to add or suggest new dates. It does not matter if adding a mail is optional or not-needed.

What did you expect, how polls should behave instead?

When creating a poll with option to add/suggest dates enabled, I'd expect this to be working

What steps does it need to replay this bug?

  1. Create a new poll
  2. Enable option to add/suggest new dates
  3. Add dates or not
  4. share via link
  5. open share-link
  6. give name
  7. try to add a new date with time or date-range, etc.
  8. error appears

Installation method

Installed/updated from the appstore (Apps section of your site)

Installation type

Updated from a minor version within same major version (i.e. 4.0.0 to 4.1.1)

Affected polls version

6.1.6

Which browser did you use, when experiencing the bug?

Other browser

Opera

Add your browser log here

No response

Additional client environment information

No response

NC version

Nextcloud 28

Other Nextcloud version

28.0.3

PHP engine version

PHP 8.2

Other PHP version

8.2.16

Database engine

MariaDB

Database Engine version or other Database

10.6

Which user-backends are you using?

Add your nextcloud server log here

{"reqId":"ZfffCa7W6FQUTajhKegNFQAABJQ","level":3,"time":"2024-03-18T06:28:25+00:00","remoteAddr":"xx.xx.xx.xx","user":"--","app":"index","method":"POST","url":"/apps/polls/s/hhg0Ls13/option","message":"Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int in file '/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php' line 136","userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36","version":"28.0.3.2","exception":{"Exception":"Exception","Message":"Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int in file '/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php' line 136","Code":0,"Trace":[{"file":"/var/www/virtual/myserver/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Polls\\Controller\\PublicController"],"addOption"]},{"file":"/var/www/virtual/myserver/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Polls\\Controller\\PublicController","addOption",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["hhg0Ls13","polls.public.add_option"]]},{"file":"/var/www/virtual/myserver/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/polls/s/hhg0Ls13/option"]},{"file":"/var/www/virtual/myserver/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/virtual/myserver/html/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int","Code":0,"Trace":[{"file":"/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php","line":167,"function":"setter","class":"OCP\\AppFramework\\Db\\Entity","type":"->","args":["pollId",[null]]},{"file":"/var/www/virtual/myserver/html/apps/polls/lib/Service/OptionService.php","line":99,"function":"__call","class":"OCP\\AppFramework\\Db\\Entity","type":"->","args":["setPollId",[null]]},{"file":"/var/www/virtual/myserver/html/apps/polls/lib/Controller/PublicController.php","line":168,"function":"add","class":"OCA\\Polls\\Service\\OptionService","type":"->","args":[null,1711130400,"",0]},{"file":"/var/www/virtual/myserver/html/apps/polls/lib/Controller/BasePublicController.php","line":88,"function":"OCA\\Polls\\Controller\\{closure}","class":"OCA\\Polls\\Controller\\PublicController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/virtual/myserver/html/apps/polls/lib/Controller/PublicController.php","line":167,"function":"responseCreate","class":"OCA\\Polls\\Controller\\BasePublicController","type":"->","args":[["Closure"],"hhg0Ls13"]},{"file":"/var/www/virtual/myserver/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"addOption","class":"OCA\\Polls\\Controller\\PublicController","type":"->","args":["hhg0Ls13",1711130400,"",0]},{"file":"/var/www/virtual/myserver/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Polls\\Controller\\PublicController"],"addOption"]},{"file":"/var/www/virtual/myserver/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Polls\\Controller\\PublicController"],"addOption"]},{"file":"/var/www/virtual/myserver/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Polls\\Controller\\PublicController","addOption",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["hhg0Ls13","polls.public.add_option"]]},{"file":"/var/www/virtual/myserver/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/polls/s/hhg0Ls13/option"]},{"file":"/var/www/virtual/myserver/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php","Line":136},"message":"Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int in file '/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php' line 136","exception":{},"CustomMessage":"Cannot assign null to property OCA\\Polls\\Db\\Option::$pollId of type int in file '/var/www/virtual/myserver/html/lib/public/AppFramework/Db/Entity.php' line 136"}}

Additional environment informations

No response

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "myserver.domain"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.3.2",
        "overwrite.cli.url": "https:\/\/myserver.domain",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "pipe",
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "default_phone_region": "DE",
        "default_language": "de",
        "default_locale": "de_DE",
        "defaultapp": "files, dashboard",
        "skeletondirectory": "\/home\/myerver\/nextcloud_data\/skeleton",
        "simpleSignUpLink.shown": false,
        "filesystem_check_changes": 1,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "0",
            "timeout": "1.5"
        },
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "loglevel": 1,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\PNG",
            "1": "OC\\Preview\\JPEG",
            "2": "OC\\Preview\\GIF",
            "3": "OC\\Preview\\BMP",
            "4": "OC\\Preview\\MSOffice2007",
            "5": "OC\\Preview\\TXT",
            "6": "OC\\Preview\\MarkDown",
            "7": "OC\\Preview\\OpenDocument",
            "8": "OC\\Preview\\MSOffice2003",
            "9": "OC\\Preview\\MSOfficeDoc",
            "10": "OC\\Preview\\Image",
            "11": "OC\\Preview\\TIFF",
            "12": "OC\\Preview\\SVG",
            "13": "OC\\Preview\\Movie",
            "14": "OC\\Preview\\MKV",
            "15": "OC\\Preview\\MP4",
            "16": "OC\\Preview\\AVI",
            "17": "OC\\Preview\\msword",
            "19": "OC\\Preview\\MSOffice2007",
            "20": "OC\\Preview\\MSOfficeDocx",
            "21": "OC\\Preview\\MSOfficeXlsx",
            "22": "OC\\Preview\\MSOfficePptx",
            "23": "OC\\Preview\\PDF"
        },
        "theme": ""
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - approval: 1.2.0
  - bookmarks: 13.1.3
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.6
  - calendar_resource_management: 0.6.0
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - collectives: 2.10.0
  - comments: 1.18.0
  - contacts: 5.5.3
  - cookbook: 0.11.0
  - cospend: 1.6.1
  - dashboard: 7.8.0
  - dav: 1.29.1
  - deck: 1.12.2
  - drawio: 3.0.2
  - event_update_notification: 2.3.0
  - external: 5.3.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_mindmap: 0.0.30
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.17.0
  - forms: 4.1.1
  - groupfolders: 16.0.4
  - health: 2.2.2
  - integration_openstreetmap: 1.0.12
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.7
  - maps: 1.3.1
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.2
  - notifications: 2.16.0
  - notify_push: 0.6.9
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - polls: 6.1.6
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.2
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - socialsharing_email: 3.1.0
  - spreed: 18.0.5
  - support: 1.11.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tables: 0.6.6
  - tasks: 0.15.0
  - text: 3.9.1
  - text_templates: 1.0.5
  - theming: 2.3.0
  - timemanager: 0.3.12
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - users_picker: 0.2.3
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflow_script: 1.13.0
  - workflowengine: 2.10.0
Disabled:
  - contactsinteraction: 1.9.0 (installed 1.8.0)
  - encryption: 2.16.0
  - files_markdown: 2.4.1 (installed 2.4.1)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - files_texteditor: 2.15.1 (installed 2.15.1)
  - survey_client: 1.16.0 (installed 1.15.0)
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0
  - user_migration: 5.0.0 (installed 5.0.0)

Nextcloud Signing status

No errors have been found.

Additional Information

No response

Uatschitchun commented 7 months ago

No one able to approve?

javerous commented 7 months ago

Same issue here. Nextcloud Hub 7 (28.0.3) / fresh Polls install (6.1.6) / PHP 8.3.4. A occ polls:db:rebuild didn't fix the issue.

dartcafe commented 7 months ago

Sorry for delay in answering, I was bound to some open changes in the master branch and I have limited time currently.

I could reproduce the bug and fix it. If all test run through, I will probably relase 6.2 shortly.

javerous commented 7 months ago

@dartcafe Thank you very much 😊

Uatschitchun commented 7 months ago

@dartcafe no need to be sorry! Thx for fixing!

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.