Commit d32b4e4e authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3259311 by Gábor Hojtsy, daffie, murilohp: Fix database JSON detection for PostgreSQL

parent 64eeb1b7
Loading
Loading
Loading
Loading
+3 −1
Changes for src/Form/UpgradeStatusForm.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -787,7 +787,9 @@ MARKUP
      $class = 'no-known-error';
      $requirement = $this->t('Supported.');
      try {
        $this->database->query('SELECT JSON_TYPE(\'1\')');
        // A hasJson() method was added to Connection from Drupal 9.4.0
        // but we cannot rely on being on Drupal 9.4.x+
        $this->database->query($type == 'pgsql' ? 'SELECT JSON_TYPEOF(\'1\')' : 'SELECT JSON_TYPE(\'1\')');
      }
      catch (\Exception $e) {
        $class = 'known-error';