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

Running Upgrade Wizard "EXT:powermail: Migrate plugin permissions" has exception because of DB field be_groups.explicit_allowdeny #1062

Closed
sypets opened this issue Jun 20, 2024 · 1 comment

Comments

@sypets
Copy link
Contributor

sypets commented Jun 20, 2024

php vendor/bin/typo3 upgrade:run

Running Wizard "EXT:powermail: Migrate plugin permissions"
==========================================================


Uncaught TYPO3 Exception str_replace(): Argument #3 ($subject) must be of type array|string, null given
thrown in file /var/www/dev3.t3.uol.de/vendor/in2code/powermail/Classes/Update/PowermailPermissionUpdater.php
in line 116

version

  • powermail: 12.3.5
  • TYPO3: 12.4.16
  • PHP 8.2

Reason

powermail/Classes/Update/PowermailPermissionUpdater.php: Zeile 116

$newList = str_replace(array_keys($searchReplace), array_values($searchReplace), $row['explicit_allowdeny']);

https://github.com/in2code-de/powermail/blob/master/Classes/Update/PowermailPermissionUpdater.php#L116

Some DB-fields are NULL:

select uid,explicit_allowdeny from be_groups where explicit_allowdeny is NULL;

Solution

  1. in DB:

update be_groups set explicit_allowdeny='' where explicit_allowdeny is NULL;

  1. Fix code to handle NULL:
- $newList = str_replace(array_keys($searchReplace), array_values($searchReplace), $row['explicit_allowdeny']);
+ $newList = str_replace(array_keys($searchReplace), array_values($searchReplace), $row['explicit_allowdeny'] ?? '');
mschwemer added a commit that referenced this issue Jul 5, 2024
There might be situation, where the `explicit_allowdeny` column
is null. (Probably very old installations, where the column had null
as default. Providing an empty string as a fallback solves the issue.

Related: #1062
Related: #1019
Signed-off-by: Marcus Schwemer <marcus.schwemer@in2code.de>
mschwemer added a commit that referenced this issue Jul 5, 2024
There might be situation, where the `explicit_allowdeny` column
is null. (Probably very old installations, where the column had null
as default. Providing an empty string as a fallback solves the issue.

Related: #1062
Related: #1019
Signed-off-by: Marcus Schwemer <marcus.schwemer@in2code.de>
@mschwemer
Copy link
Collaborator

Solved with PR #1074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants