Problem/Motivation
It makes sense to show this on the status page:

But do we need to warn every time on drush updb if that status is available?

This seems to have started in 11.2 in ddev with MariaDB 10.6 (which supports JSON) - ie, Database::getConnection()->hasJson() returns TRUE.
Steps to reproduce
Drupal 11.2, DDEV MariaDB 10.6, run drush updb.
Proposed resolution
Show the warning only if JSON is unavailable when running updates.
Remaining tasks
Merge request
User interface changes
No JSON warning shown when running updates when JSON is supported
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3532243-nr-bot.txt | 91 bytes | needs-review-queue-bot |
| #2 | drush-updb.png | 15.72 KB | scott_euser |
| status-report.png | 18.67 KB | scott_euser |
Issue fork drupal-3532243
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
scott_euser commentedComment #3
scott_euser commentedComment #5
cilefen commentedComment #6
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #8
mstrelan commentedRebased against 11.x but now the MR needs to be updated to point to that branch, which I can't do.
The logic is a bit confusing though with the multiple conditions and overrides, I'm sure it could be refactored to be easier to read.
Comment #9
tjtj commentedI see this too and am confused about what to do.
Comment #10
scott_euser commentedRe #8 whoops sorry retargeted branch to 11x
Re #9 do you mean what to do if your database doesn't support json? You need to make sure your database is one the supported ones at https://www.drupal.org/docs/getting-started/system-requirements/database...
Leaving as needs work per refactor note in #8
Comment #11
tjtj commentedIt is 10.6.20-MariaDB, for Linux. I think it supports JSON. Everything works. So is this message erroneous?
Comment #12
pwarn commentedI am also getting this warning with Drupal 11.2.4 / MariaDB 12.0.2
Comment #13
scott_euser commentedRefactored it, this I think is the most easy to read, but has the downside of repeating the title & description. Could move those into variables I suppose, but maybe this is keeping it simpler?
Comment #14
smustgrave commentedCould we get a simple test case for it?
Comment #15
oily commentedRe: #13 looked at structuring the code differently using switch of something new like match but not sure there is any better, more readable way to structure it.
Been grepping existing test code for the variable $phase, and the strings 'update' and 'runtime' but unsuccessful. Seems difficult to work out where to put the test case.
Comment #18
eduardo morales albertiMerge main into the branch and move the check to core/modules/system/src/Hook/SystemRequirementsHooks.php as the System requirements changed on issue https://www.drupal.org/project/drupal/issues/3554134
Comment #19
berdirWhile a sensible cleanup that's in consistent with other requirements, I think this is actually a bug in drush. The requirement here is an OK, not a warning. Drush isn't meant to show "OK" requirements. However, that logic wasn't updated to support the new enums, see \Drush\Commands\core\UpdateDBCommands::updateCheckRequirements.
It treats anything that isn't an old OK or ERROR severity as a warning.
I opened https://github.com/drush-ops/drush/issues/6528.