### ⚠️ This issue respects the following points: ⚠️
- [X] This is a **bug**, no…t a question or a configuration/webserver/proxy issue.
- [X] This issue is **not** already reported on Github _(I've searched it)_.
- [X] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### What went wrong, what did you observe?
Since the update from 5.2 to 5.3.0, I can't share my poll using a public link when clicking on "Add a new public link". The error notification "Error adding public link" pops up.
Internal access/public access toggle still works as expected.
![image](https://github.com/nextcloud/polls/assets/77641728/e3c0da9d-bb97-456b-be35-5b46ce518ded)
### What did you expect, how polls should behave instead?
Polls should create a public link that I could share.
### What steps does it need to replay this bug?
1. Create a new poll.
2. Try sharing it using the public link feature.
### 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
5.3.0
### Which browser did you use, when experiencing the bug?
- [X] Firefox
- [X] Chrome
- [X] Chromium/Chromium based (i.e. Edge)
- [ ] Safari
- [ ] Other/Don't know
### Other browser
_No response_
### Add your browser log here
_No response_
### Additional client environment information
_No response_
### NC version
Nextcloud 27 (Nextcloud Hub 5)
### Other Nextcloud version
_No response_
### PHP engine version
PHP 7.3
### Other PHP version
8.2.10
### Database engine
MySQL
### Database Engine version or other Database
10.10.2
### Which user-backends are you using?
- [ ] Default user-backend _(database)_
- [ ] LDAP/ Active Directory
- [X] SSO - SAML
- [ ] Other/Don't know
### Add your nextcloud server log here
```shell
[PHP] Erreur: Undefined variable $share at /var/www/html/custom_apps/polls/lib/Service/ShareService.php#460
POST /apps/polls/poll/135/share
from IP.***.***.*** by keycloak-**user at 2023-09-08T14:30:24+00:00
[index] Erreur: Exception: OCA\Polls\Service\ShareService::add(): Return value must be of type OCA\Polls\Db\Share, null returned in file '/var/www/html/custom_apps/polls/lib/Service/ShareService.php' line 460 at <<closure>>
0. /var/www/html/lib/private/AppFramework/App.php line 183
OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\Polls\\Co ... "], "add")
1. /var/www/html/lib/private/Route/Router.php line 315
OC\AppFramework\App::main("OCA\\Polls\\Controller\\ShareController", "add", ["OC\\AppFramewo ... "], ["135","polls.share.add"])
2. /var/www/html/lib/base.php line 1071
OC\Route\Router->match("/apps/polls/poll/135/share")
3. /var/www/html/index.php line 36
OC::handleRequest()
Caused by:
TypeError: OCA\Polls\Service\ShareService::add(): Return value must be of type OCA\Polls\Db\Share, null returned at <<closure>>
0. /var/www/html/custom_apps/polls/lib/Controller/ShareController.php line 59
OCA\Polls\Service\ShareService->add(135, "public", "", "", "")
1. /var/www/html/custom_apps/polls/lib/Controller/BaseController.php line 87
OCA\Polls\Controller\ShareController->OCA\Polls\Controller\{closure}("*** sensitive parameters replaced ***")
2. /var/www/html/custom_apps/polls/lib/Controller/ShareController.php line 59
OCA\Polls\Controller\BaseController->responseCreate(["Closure"])
3. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
OCA\Polls\Controller\ShareController->add(135, "public", "", "", "")
4. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
OC\AppFramework\Http\Dispatcher->executeController(["OCA\\Polls\\Co ... "], "add")
5. /var/www/html/lib/private/AppFramework/App.php line 183
OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\Polls\\Co ... "], "add")
6. /var/www/html/lib/private/Route/Router.php line 315
OC\AppFramework\App::main("OCA\\Polls\\Controller\\ShareController", "add", ["OC\\AppFramewo ... "], ["135","polls.share.add"])
7. /var/www/html/lib/base.php line 1071
OC\Route\Router->match("/apps/polls/poll/135/share")
8. /var/www/html/index.php line 36
OC::handleRequest()
POST /apps/polls/poll/135/share
```
### Additional environment informations
_No response_
### Configuration report
```shell
{
"system": {
"htaccess.RewriteBase": "\/",
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.locking": "\\OC\\Memcache\\Redis",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"password": "***REMOVED SENSITIVE VALUE***"
},
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***",
"***",
"cloud.***.**"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"default_language": "fr",
"default_locale": "fr_CH",
"default_phone_region": "CH",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "27.0.2.1",
"overwrite.cli.url": "https:\/\/cloud.***.***",
"overwriteprotocol": "https",
"overwritehost": "cloud.***.***",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"onlyoffice": {
"verify_peer_off": true
},
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"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***",
"maintenance": false,
"loglevel": 0,
"theme": "",
"social_login_auto_redirect": true,
"mail_smtpsecure": "tls",
"activity_expire_days": "30",
"app_install_overwrite": [
"shifts"
]
}
}
```
### List of activated Apps
```shell
Enabled:
- activity: 2.19.0
- bruteforcesettings: 2.7.0
- calendar: 4.4.5
- circles: 27.0.1
- cloud_federation_api: 1.10.0
- comments: 1.17.0
- contacts: 5.3.2
- contactsinteraction: 1.8.0
- dav: 1.27.0
- external: 5.2.1
- federatedfilesharing: 1.17.0
- federation: 1.17.0
- files: 1.22.0
- files_accesscontrol: 1.17.0
- files_pdfviewer: 2.8.0
- files_rightclick: 1.6.0
- files_sharing: 1.19.0
- files_trashbin: 1.17.0
- files_versions: 1.20.0
- forms: 3.3.1
- logreader: 2.12.0
- lookup_server_connector: 1.15.0
- nextcloud_announcements: 1.16.0
- notes: 4.8.1
- notifications: 2.15.0
- oauth2: 1.15.1
- password_policy: 1.17.0
- phonetrack: 0.7.6
- polls: 5.3.0
- privacy: 1.11.0
- provisioning_api: 1.17.0
- related_resources: 1.2.0
- richdocuments: 8.1.1
- serverinfo: 1.17.0
- settings: 1.9.0
- sharebymail: 1.17.0
- side_menu: 3.10.3
- snappymail: 2.28.4
- sociallogin: 5.5.3
- spreed: 17.0.3
- support: 1.10.0
- survey_client: 1.15.0
- systemtags: 1.17.0
- tasks: 0.15.0
- text: 3.8.0
- theming: 2.2.0
- twofactor_backupcodes: 1.16.0
- updatenotification: 1.17.0
- user_status: 1.7.0
- viewer: 2.1.0
- workflowengine: 2.9.0
Disabled:
- admin_audit: 1.17.0
- dashboard: 7.7.0 (installed 7.3.0)
- encryption: 2.15.0
- event_update_notification: 2.2.0 (installed 2.2.0)
- files_external: 1.19.0
- firstrunwizard: 2.16.0 (installed 2.12.0)
- guests: 2.5.0 (installed 2.5.0)
- maps: 1.1.1 (installed 1.1.1)
- passwords: 2023.9.30 (installed 2023.9.30)
- photos: 2.3.0 (installed 1.5.0)
- recommendations: 1.6.0 (installed 1.2.0)
- shifts: 1.9.3 (installed 1.9.3)
- suspicious_login: 5.0.0
- twofactor_totp: 9.0.0
- user_ldap: 1.17.0
- weather_status: 1.7.0 (installed 1.3.0)
- workflow_script: 1.12.0 (installed 1.12.0)
```
### Nextcloud Signing status
```shell
No errors have been found.
```
### Additional Information
_No response_