Merge pull request #9850 from nextcloud/fix/noid/setup-check-empty-index
Fix wrong hint about missing indexes
This commit is contained in:
commit
6756c8d2b5
|
@ -183,7 +183,7 @@
|
|||
type: OC.SetupChecks.MESSAGE_TYPE_INFO
|
||||
})
|
||||
}
|
||||
if (data.hasMissingIndexes) {
|
||||
if (data.hasMissingIndexes.length > 0) {
|
||||
var listOfMissingIndexes = "";
|
||||
data.hasMissingIndexes.forEach(function(element){
|
||||
listOfMissingIndexes += "<li>";
|
||||
|
|
|
@ -157,7 +157,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -191,7 +192,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -226,7 +228,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -259,7 +262,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -290,7 +294,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -321,7 +326,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -352,7 +358,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: false,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -404,7 +411,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
hasPassedCodeIntegrityCheck: true,
|
||||
isOpcacheProperlySetup: true,
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -436,7 +444,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
isOpcacheProperlySetup: false,
|
||||
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: true
|
||||
hasFreeTypeSupport: true,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -468,7 +477,8 @@ describe('OC.SetupChecks tests', function() {
|
|||
isOpcacheProperlySetup: true,
|
||||
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
|
||||
isSettimelimitAvailable: true,
|
||||
hasFreeTypeSupport: false
|
||||
hasFreeTypeSupport: false,
|
||||
hasMissingIndexes: []
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 Morris Jobke <hey@morrisjobke.de>
|
||||
*
|
||||
|
@ -21,19 +22,18 @@
|
|||
|
||||
namespace OC\DB;
|
||||
|
||||
|
||||
class MissingIndexInformation {
|
||||
|
||||
private $listOfMissingIndexes = [];
|
||||
|
||||
public function addHintForMissingSubject($tableName, $indexName) {
|
||||
public function addHintForMissingSubject(string $tableName, string $indexName) {
|
||||
$this->listOfMissingIndexes[] = [
|
||||
'tableName' => $tableName,
|
||||
'indexName' => $indexName
|
||||
];
|
||||
}
|
||||
|
||||
public function getListOfMissingIndexes() {
|
||||
public function getListOfMissingIndexes(): array {
|
||||
return $this->listOfMissingIndexes;
|
||||
}
|
||||
}
|
|
@ -415,11 +415,7 @@ Raw output
|
|||
return function_exists('imagettfbbox') && function_exists('imagettftext');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the required FreeType functions are present
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasMissingIndexes() {
|
||||
protected function hasMissingIndexes(): array {
|
||||
$indexInfo = new MissingIndexInformation();
|
||||
// Dispatch event so apps can also hint for pending index updates if needed
|
||||
$event = new GenericEvent($indexInfo);
|
||||
|
|
Loading…
Reference in New Issue