-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Set empty authtoken names to 'none' #30815
Conversation
|
|
||
public function sql(IDBConnection $connection) { | ||
$q = $connection->getQueryBuilder(); | ||
$q->automaticTablePrefix(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we never used this before I hope it doesn't break 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to get the table prefix? I saw that migration kind "schema" injects prefix trough a param. But this is not the case here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do you mean query builder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah now I remember: you don't need to bother about table prefix. Just remove line 15 and that's it.
|
||
$q->update('authtoken') | ||
->set('name', '(none)') | ||
->where("name = ''") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use expression builder
$q->update('authtoken') | ||
->set('name', '(none)') | ||
->where("name = ''") | ||
->orWhere('name IS NULL') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use expression builder
ce25085
to
cbdc4be
Compare
Codecov Report
@@ Coverage Diff @@
## master #30815 +/- ##
============================================
- Coverage 62.25% 62.25% -0.01%
- Complexity 18205 18206 +1
============================================
Files 1140 1141 +1
Lines 68043 68050 +7
Branches 1230 1230
============================================
Hits 42362 42362
- Misses 25318 25325 +7
Partials 363 363
Continue to review full report at Codecov.
|
cbdc4be
to
9947d69
Compare
@DeepDiver1975 Plz merge :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@IljaN please backport |
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. |
Description
Empty authtokens names were allowed in earlier versions, but are now disallowed. This results in a crash during login when empty authokens are encountered from previous version
This migration sets all empty authtoken names to 'none'.
Related Issue
#30792
Types of changes