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

Polls do not load after upgrade to 7.0.0 #3393

Closed
6 of 12 tasks
g1smo opened this issue Mar 27, 2024 · 5 comments · Fixed by #3394
Closed
6 of 12 tasks

Polls do not load after upgrade to 7.0.0 #3393

g1smo opened this issue Mar 27, 2024 · 5 comments · Fixed by #3394
Labels
Milestone

Comments

@g1smo
Copy link

g1smo commented Mar 27, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Nextcloud's Code of Conduct.

What went wrong, what did you observe?

After upgrading the polls app, polls do not load.

What did you expect, how polls should behave instead?

The polls should load

What steps does it need to replay this bug?

  1. Upgrade polls
  2. Visit the app

Installation method

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

Installation type

Updated from previous major version (i.e. 3.x.x to 4.x.x)

Affected polls version

7.0.0

Which browser did you use, when experiencing the bug?

  • Firefox
  • Chrome
  • 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 28

Other Nextcloud version

No response

PHP engine version

PHP 8.2

Other PHP version

No response

Database engine

PostgreSQL

Database Engine version or other Database

No response

Which user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other/Don't know

Add your nextcloud server log here

{
	"reqId": "r2Knd5NPYRCnGXkqtt14",
	"level": 3,
	"time": "March 27, 2024 21:20:03",
	"remoteAddr": "",
	"user": "--",
	"app": "core",
	"method": "",
	"url": "--",
	"message":"Error while running bac
kground job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )","userAgent":"--","version":"28.0.3.2","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Mes
sage":"An exception occurred while executing a query: SQLSTATE[
		42601
	]: Syntax error: 7 ERROR:  zero-length delimited identifier at or near \"\"\"\"\nLINE 1: ...\") AS \"curr
ent_user_votes\", coalesce(shares.type, \"\") AS use...\n                                                             ^",
	"Code": 7,
	"Trace": [
		{
			"file":"/var/www/obzorje/lib/priv
ate/DB/QueryBuilder/QueryBuilder.php","line":295,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":": : "},{"file":"/var/www/obzorje/lib/public/AppFramework
/Db/QBMapper.php","line":335,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Db/PollMapper.php","line": 72,
			"function": "findEntities",
			"class": "OCP\\AppFramework\\Db\\QBMapper",
			"type": "->"
		},
		{
			"file": "/var/www/obzorje/apps/polls/lib/Service/MailService.php",
			"line": 224,"func
tion":"findAutoReminderPolls","class":"OCA\\Polls\\Db\\PollMapper","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Cron/AutoReminderCron.php","line":49,"function":"sen
dAutoReminder","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\P
olls\\Cron\\AutoReminderCron","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","
type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/w
ww/obzorje/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/obzorje/lib/private/DB/Exceptions/DbalException.ph
p","Line":71,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[
				42601
			]: Syntax erro
r: 7 ERROR:  zero-length delimited identifier at or near \"\"\"\"\nLINE 1: ...\") AS \"current_user_votes\", coalesce(shares.type, \"\") AS use...\n                         
                                    ^","Code":7,"Trace":[{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Connection.php","line":1938,"function":"convert","class":"Doctr
ine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Connection.php","line":1880,"function":"handleDrive
rException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Connection.php","line":1105,"function":"convertExceptionDu
ringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/obzorje/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\
\DBAL\\Connection","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection
","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder
","type":"->"},{"file":"/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"
->"},{"file":"/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php","line":293,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file
":"/var/www/obzorje/lib/public/AppFramework/Db/QBMapper.php","line":335,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www
/obzorje/apps/polls/lib/Db/PollMapper.php","line":72,"function":"findEntities","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/www/obzorje/apps/polls/li
b/Service/MailService.php","line":224,"function":"findAutoReminderPolls","class":"OCA\\Polls\\Db\\PollMapper","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Cron/Auto
ReminderCron.php","line":49,"function":"sendAutoReminder","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/Job.php",
			"line": 81,
			"function": "run",
			"class": "OCA\\Polls\\Cron\\AutoReminderCron",
			"type": "->"
		},
		{
			"file": "/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php",
			"line": 102,
			"function": "start",
			"class": "OCP\\BackgroundJob\\Job",
			"type": "->"
		},
		{
			"file": "/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php",
			"line": 92,
			"function": "start",
			"class":"OCP\\Background
Job\\TimedJob","type":"->"},{"file":"/var/www/obzorje/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/obzorje
/apps/polls/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":62,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLS
TATE[
				42601
			]: Syntax error: 7 ERROR:  zero-length delimited identifier at or near \"\"\"\"\nLINE 1: ...\") AS \"current_user_votes\", coalesce(shares.type, \"\") AS use...\n 
                                                            ^","Code":7,"Trace":[{"file":"/var/www/obzorje/apps/polls/vendor/doctrine/dbal/src/Driver/PDO/Statement.php","lin
e":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":": : "},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Connection.php","line":1098,"funct
ion":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/obzorje/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php","line":293,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/obzorje/lib/public/AppFramework/Db/QBMapper.php","line":335,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Db/PollMapper.php","line":72,"function":"findEntities","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Service/MailService.php","line":224,"function":"findAutoReminderPolls","class":"OCA\\Polls\\Db\\PollMapper","type":"->"},{"file":"/var/www/obzorje/apps/polls/lib/Cron/AutoReminderCron.php","line":49,"function":"sendAutoReminder","class":"OCA\\Polls\\Service\\MailService","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\Polls\\Cron\\AutoReminderCron","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/obzorje/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/obzorje/apps/polls/vendor/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[
				42601
			]: Syntax error: 7 ERROR:  zero-length delimited identifier at or near \"\"\"\"\nLINE 1: ...\") AS \"current_user_votes\", coalesce(shares.type, \"\") AS use...\n                                                             ^",
			"Code": "42601",
			"Trace": [
				{
					"file": "/var/www/obzorje/apps/polls/vendor/doctrine/dbal/src/Driver/PDO/Statement.php",
					"line": 130,
					"function": "execute",
					"class": "PDOStatement",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/3rdparty/doctrine/dbal/src/Connection.php",
					"line": 1098,
					"function": "execute",
					"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/private/DB/Connection.php",
					"line": 261,
					"function": "executeQuery",
					"class": "Doctrine\\DBAL\\Connection",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
					"line": 337,
					"function": "executeQuery",
					"class": "OC\\DB\\Connection",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
					"line": 377,
					"function": "executeQuery",
					"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php",
					"line": 280,
					"function": "execute",
					"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/private/DB/QueryBuilder/QueryBuilder.php",
					"line": 293,
					"function": "execute",
					"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/public/AppFramework/Db/QBMapper.php",
					"line": 335,
					"function": "executeQuery",
					"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/apps/polls/lib/Db/PollMapper.php",
					"line": 72,
					"function": "findEntities",
					"class": "OCP\\AppFramework\\Db\\QBMapper",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/apps/polls/lib/Service/MailService.php",
					"line": 224,
					"function": "findAutoReminderPolls",
					"class": "OCA\\Polls\\Db\\PollMapper",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/apps/polls/lib/Cron/AutoReminderCron.php",
					"line": 49,
					"function": "sendAutoReminder",
					"class": "OCA\\Polls\\Service\\MailService",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/public/BackgroundJob/Job.php",
					"line": 81,
					"function": "run",
					"class": "OCA\\Polls\\Cron\\AutoReminderCron",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php",
					"line": 102,
					"function": "start",
					"class": "OCP\\BackgroundJob\\Job",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/lib/public/BackgroundJob/TimedJob.php",
					"line": 92,
					"function": "start",
					"class": "OCP\\BackgroundJob\\TimedJob",
					"type": "->"
				},
				{
					"file": "/var/www/obzorje/cron.php",
					"line": 152,
					"function": "execute",
					"class": "OCP\\BackgroundJob\\TimedJob",
					"type": "->"
				}
			],
			"File": "/var/www/obzorje/apps/polls/vendor/doctrine/dbal/src/Driver/PDO/Statement.php",
			"Line": 130
		}
	}
},
"message": "Error while running background job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )",
"exception": {},
"CustomMessage": "Error while running background job (class: OCA\\Polls\\Cron\\AutoReminderCron, arguments: )"
}
}

Additional environment informations

No response

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "obzorje.kompot.si",
            "oo.kompot.si"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "28.0.3.2",
        "overwrite.cli.url": "https:\/\/obzorje.kompot.si",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mysql.utf8mb4": true,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0,
            "dbindex": 0
        },
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "logfilemode": 416,
        "logdateformat": "F d, Y H:i:s",
        "onlyoffice": {
            "verify_peer_off": true,
            "jwt_secret": "***REMOVED SENSITIVE VALUE***",
            "jwt_header": "AuthorizationJwt"
        },
        "allow_local_remote_servers": true,
        "lookup_server": "",
        "theme": "",
        "default_phone_region": "SI",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "files_texteditor",
            "onlyoffice",
            "files_markdown"
        ],
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "maintenance_window_start": 1
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bookmarks: 13.1.3
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.7
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.3
  - contactsinteraction: 1.9.0
  - dav: 1.29.1
  - drawio: 3.0.2
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_markdown: 2.4.2
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_texteditor: 2.15.2
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - forms: 4.1.1
  - impersonate: 1.15.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - music: 1.10.0
  - news: 25.0.0-alpha3
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.3
  - notifications: 2.16.0
  - notify_push: 0.6.10
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - passwords: 2024.3.20
  - photos: 2.4.0
  - polls: 7.0.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.3
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - support: 1.11.0
  - survey_client: 1.16.0
  - systemtags: 1.18.0
  - theming: 2.3.0
  - theming_customcss: 1.15.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_ldap: 1.19.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - apporder: 0.15.0 (installed 0.15.0)
  - audioplayer: 3.4.1 (installed 3.4.1)
  - dashboard: 7.8.0 (installed 7.1.0)
  - encryption: 2.16.0
  - external: 5.3.1 (installed 5.3.1)
  - extract: 1.3.6 (installed 1.3.6)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - groupfolders: 16.0.4 (installed 16.0.4)
  - metadata: 0.19.0 (installed 0.19.0)
  - recommendations: 2.0.0 (installed 0.7.0)
  - spreed: 18.0.5 (installed 18.0.5)
  - suspicious_login: 6.0.0
  - testing: 1.17.0
  - text: 3.9.1 (installed 3.4.0)
  - twofactor_totp: 10.0.0-beta.2

Nextcloud Signing status

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- core/js/mimetypelist.js

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [core/js/mimetypelist.js] => Array
                        (
                            [expected] => 550ab566d30693bfa24ec4b15d9df87731ae8a3be8f79dabf94757e5b8b20eec6e4b678f17af1718297f2872f6b04519eeb024d1dff11947f29da431c7f11201
                            [current] => 8e2b7646e9c217fb6556038e9ec780094015c262d9933eb0885b56cf58a74c2722bd65f86adad7b01e0f444857ce2ab36a15302fc359032d50d25e25f699f6fb
                        )

                )

        )

)

Additional Information

No response

@g1smo g1smo added the bug label Mar 27, 2024
@g1smo
Copy link
Author

g1smo commented Mar 27, 2024

The changes below fix the issue for me.

diff --git a/lib/Db/PollMapper.php b/lib/Db/PollMapper.php
index 1820e8a6..87980c9b 100644
--- a/lib/Db/PollMapper.php
+++ b/lib/Db/PollMapper.php
@@ -181,6 +181,8 @@ class PollMapper extends QBMapper {
                $this->joinCurrentUserVotes($qb, self::TABLE, $currentUserId);
                $this->joinUserRole($qb, self::TABLE, $currentUserId);
                $qb->groupBy(self::TABLE . '.id');
+               $qb->addGroupBy('shares.type');
+               $qb->addGroupBy('shares.locked');
                return $qb;
        }
 
@@ -192,7 +194,7 @@ class PollMapper extends QBMapper {
         */
        protected function joinUserRole(IQueryBuilder &$qb, string $fromAlias, string $currentUserId): void {
                $joinAlias = 'shares';
-               $qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.type, "") AS user_role'));
+               $qb->addSelect($qb->createFunction('coalesce(' . $joinAlias . '.type, \'\') AS user_role'));
                $qb->selectAlias($joinAlias . '.locked', 'is_current_user_locked');
 
                $qb->leftJoin(
diff --git a/lib/Db/Preferences.php b/lib/Db/Preferences.php
index 7bad0633..356128be 100644
--- a/lib/Db/Preferences.php
+++ b/lib/Db/Preferences.php
@@ -70,7 +70,7 @@ class Preferences extends Entity implements JsonSerializable {
        }
 
        public function getPreferences_decoded(): mixed {
-               return json_decode($this->getPreferences());
+               return json_decode($this->getPreferences() ?: '');
        }
 
        /**

dartcafe added a commit that referenced this issue Mar 28, 2024
Signed-off-by: dartcafe <github@dartcafe.de>
@dartcafe
Copy link
Collaborator

@g1smo Since I have no possibility to check agains PostgreeSQL:

Could you test the change in #3394?

@smellord
Copy link

smellord commented Mar 28, 2024

#!/bin/bash

Define file paths

POLL_MAPPER_FILE="./PollMapper.php"
PREFERENCES_FILE="./Preferences.php"

Create backups

cp "$POLL_MAPPER_FILE" "${POLL_MAPPER_FILE}.bak"
echo "Backup of PollMapper.php created."

cp "$PREFERENCES_FILE" "${PREFERENCES_FILE}.bak"
echo "Backup of Preferences.php created."

Apply changes to PollMapper.php

sed -i '/$qb->groupBy(self::TABLE . \x27.id\x27);/a \ $qb->addGroupBy(\x27shares.type\x27);\n $qb->addGroupBy(\x27shares.locked\x27);' "$POLL_MAPPER_FILE"
sed -i "s/coalesce(.type, "") AS user_role/coalesce(.type, '') AS user_role/" "$POLL_MAPPER_FILE"
echo "Changes applied to PollMapper.php."

Apply changes to Preferences.php

sed -i "s/return json_decode($this->getPreferences());/return json_decode($this->getPreferences() ?: '');/" "$PREFERENCES_FILE"
echo "Changes applied to Preferences.php."

echo "Script execution completed."

you can try this script to implement the bugfix

@dartcafe
Copy link
Collaborator

Ah. Don't care. I noticed a simple unit test was missing for recognizing this error in the CI process.

@dartcafe dartcafe added this to the 7.0.1 milestone Mar 29, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants