Skip to content

Commit 0cf1843

Browse files
committed
Fix /check-relations page
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent fb1a7c1 commit 0cf1843

5 files changed

Lines changed: 31 additions & 51 deletions

File tree

libraries/classes/ConfigStorage/RelationParameters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public static function fromArray(array $params): self
310310
/**
311311
* @return array<string, bool|string|null>
312312
* @psalm-return array{
313-
* version: non-empty-string,
313+
* version: string,
314314
* user: (string|null),
315315
* db: (string|null),
316316
* bookmark: (string|null),

libraries/classes/Controllers/CheckRelationsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __invoke(ServerRequest $request): void
6060
$this->render('relation/check_relations', [
6161
'db' => $db,
6262
'zero_conf' => $cfg['ZeroConf'],
63-
'relation_parameters' => $relationParameters,
63+
'relation_parameters' => $relationParameters->toArray(),
6464
'sql_dir' => SQL_DIR,
6565
'config_storage_database_name' => $cfgStorageDbName,
6666
'are_config_storage_tables_defined' => $this->relation->arePmadbTablesDefined(),

phpstan-baseline.neon

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9885,21 +9885,6 @@ parameters:
98859885
count: 1
98869886
path: test/classes/Config/SettingsTest.php
98879887

9888-
-
9889-
message: "#^Method PhpMyAdmin\\\\Tests\\\\ConfigStorage\\\\RelationParametersTest\\:\\:providerForTestRelationParameters\\(\\) return type has no value type specified in iterable type array\\.$#"
9890-
count: 1
9891-
path: test/classes/ConfigStorage/RelationParametersTest.php
9892-
9893-
-
9894-
message: "#^Method PhpMyAdmin\\\\Tests\\\\ConfigStorage\\\\RelationParametersTest\\:\\:testRelationParameters\\(\\) has parameter \\$expected with no value type specified in iterable type array\\.$#"
9895-
count: 1
9896-
path: test/classes/ConfigStorage/RelationParametersTest.php
9897-
9898-
-
9899-
message: "#^Method PhpMyAdmin\\\\Tests\\\\ConfigStorage\\\\RelationParametersTest\\:\\:testRelationParameters\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
9900-
count: 1
9901-
path: test/classes/ConfigStorage/RelationParametersTest.php
9902-
99039888
-
99049889
message: "#^Method PhpMyAdmin\\\\Tests\\\\ConfigTest\\:\\:configPaths\\(\\) return type has no value type specified in iterable type array\\.$#"
99059890
count: 1

psalm-baseline.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,11 +1010,6 @@
10101010
<code>is_scalar($GLOBALS['cfg']['ForeignKeyDropdownOrder'][1])</code>
10111011
</RedundantCondition>
10121012
</file>
1013-
<file src="libraries/classes/ConfigStorage/RelationParameters.php">
1014-
<ArgumentTypeCoercion occurrences="1">
1015-
<code>$version</code>
1016-
</ArgumentTypeCoercion>
1017-
</file>
10181013
<file src="libraries/classes/ConfigStorage/UserGroups.php">
10191014
<MixedArgument occurrences="9">
10201015
<code>$key</code>

templates/relation/check_relations.twig

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{% endif %}
2727
{% endif %}
2828
{% else %}
29-
{% if not relation_parameters.hasAllFeatures() and zero_conf and are_config_storage_tables_defined %}
29+
{% if not relation_parameters.allworks and zero_conf and are_config_storage_tables_defined %}
3030
{% apply format('<a href="' ~ url('/check-relations') ~ '" data-post="' ~ get_common({'db': db, 'fix_pmadb': true, 'goto': url('/database/operations')}) ~ '">', '</a>')|notice %}
3131
{% trans '%sCreate%s missing phpMyAdmin configuration storage tables.' %}
3232
{% endapply %}
@@ -60,7 +60,7 @@
6060
<tr>
6161
<td colspan="2" class="text-end">
6262
{% trans 'General relation features:' %}
63-
{% if relation_parameters.relationFeature is not null %}
63+
{% if relation_parameters.relwork %}
6464
<span class="text-success">{% trans 'Enabled' %}</span>
6565
{% else %}
6666
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -75,7 +75,7 @@
7575
{{ show_docu('config', 'cfg_Servers_table_info') }}
7676
</th>
7777
<td class="text-end">
78-
{% if relation_parameters.tableInfo is not null %}
78+
{% if relation_parameters.table_info is not null %}
7979
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
8080
{% else %}
8181
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -85,7 +85,7 @@
8585
<tr>
8686
<td colspan="2" class="text-end">
8787
{% trans 'Display features:' %}
88-
{% if relation_parameters.displayFeature is not null %}
88+
{% if relation_parameters.displaywork %}
8989
<span class="text-success">{% trans 'Enabled' %}</span>
9090
{% else %}
9191
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -100,7 +100,7 @@
100100
{{ show_docu('config', 'cfg_Servers_table_coords') }}
101101
</th>
102102
<td class="text-end">
103-
{% if relation_parameters.tableCoords is not null %}
103+
{% if relation_parameters.table_coords is not null %}
104104
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
105105
{% else %}
106106
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -113,7 +113,7 @@
113113
{{ show_docu('config', 'cfg_Servers_pdf_pages') }}
114114
</th>
115115
<td class="text-end">
116-
{% if relation_parameters.pdfPages is not null %}
116+
{% if relation_parameters.pdf_pages is not null %}
117117
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
118118
{% else %}
119119
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -123,7 +123,7 @@
123123
<tr>
124124
<td colspan="2" class="text-end">
125125
{% trans 'Designer and creation of PDFs:' %}
126-
{% if relation_parameters.pdfFeature is not null %}
126+
{% if relation_parameters.pdfwork %}
127127
<span class="text-success">{% trans 'Enabled' %}</span>
128128
{% else %}
129129
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -138,7 +138,7 @@
138138
{{ show_docu('config', 'cfg_Servers_column_info') }}
139139
</th>
140140
<td class="text-end">
141-
{% if relation_parameters.columnInfo is not null %}
141+
{% if relation_parameters.column_info is not null %}
142142
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
143143
{% else %}
144144
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -148,7 +148,7 @@
148148
<tr>
149149
<td colspan="2" class="text-end">
150150
{% trans 'Displaying column comments:' %}
151-
{% if relation_parameters.columnCommentsFeature is not null %}
151+
{% if relation_parameters.commwork %}
152152
<span class="text-success">{% trans 'Enabled' %}</span>
153153
{% else %}
154154
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -158,14 +158,14 @@
158158
<tr>
159159
<td colspan="2" class="text-end">
160160
{% trans 'Browser transformation:' %}
161-
{% if relation_parameters.browserTransformationFeature is not null %}
161+
{% if relation_parameters.mimework %}
162162
<span class="text-success">{% trans 'Enabled' %}</span>
163163
{% else %}
164164
<span class="text-danger">{% trans 'Disabled' %}</span>
165165
{% endif %}
166166
</td>
167167
</tr>
168-
{% if relation_parameters.columnCommentsFeature is not null and relation_parameters.browserTransformationFeature is null %}
168+
{% if relation_parameters.commwork and not relation_parameters.mimework %}
169169
<tr>
170170
<td colspan="2" class="text-end">
171171
<span class="text-danger">
@@ -193,7 +193,7 @@
193193
<tr>
194194
<td colspan="2" class="text-end">
195195
{% trans 'Bookmarked SQL query:' %}
196-
{% if relation_parameters.bookmarkFeature is not null %}
196+
{% if relation_parameters.bookmarkwork %}
197197
<span class="text-success">{% trans 'Enabled' %}</span>
198198
{% else %}
199199
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -218,7 +218,7 @@
218218
<tr>
219219
<td colspan="2" class="text-end">
220220
{% trans 'SQL history:' %}
221-
{% if relation_parameters.sqlHistoryFeature is not null %}
221+
{% if relation_parameters.historywork %}
222222
<span class="text-success">{% trans 'Enabled' %}</span>
223223
{% else %}
224224
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -243,7 +243,7 @@
243243
<tr>
244244
<td colspan="2" class="text-end">
245245
{% trans 'Persistent recently used tables:' %}
246-
{% if relation_parameters.recentlyUsedTablesFeature is not null %}
246+
{% if relation_parameters.recentwork %}
247247
<span class="text-success">{% trans 'Enabled' %}</span>
248248
{% else %}
249249
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -268,7 +268,7 @@
268268
<tr>
269269
<td colspan="2" class="text-end">
270270
{% trans 'Persistent favorite tables:' %}
271-
{% if relation_parameters.favoriteTablesFeature is not null %}
271+
{% if relation_parameters.favoritework %}
272272
<span class="text-success">{% trans 'Enabled' %}</span>
273273
{% else %}
274274
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -283,7 +283,7 @@
283283
{{ show_docu('config', 'cfg_Servers_table_uiprefs') }}
284284
</th>
285285
<td class="text-end">
286-
{% if relation_parameters.tableUiprefs is not null %}
286+
{% if relation_parameters.table_uiprefs is not null %}
287287
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
288288
{% else %}
289289
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -293,7 +293,7 @@
293293
<tr>
294294
<td colspan="2" class="text-end">
295295
{% trans 'Persistent tables\' UI preferences:' %}
296-
{% if relation_parameters.uiPreferencesFeature is not null %}
296+
{% if relation_parameters.uiprefswork %}
297297
<span class="text-success">{% trans 'Enabled' %}</span>
298298
{% else %}
299299
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -318,7 +318,7 @@
318318
<tr>
319319
<td colspan="2" class="text-end">
320320
{% trans 'Tracking:' %}
321-
{% if relation_parameters.trackingFeature is not null %}
321+
{% if relation_parameters.trackingwork %}
322322
<span class="text-success">{% trans 'Enabled' %}</span>
323323
{% else %}
324324
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -343,7 +343,7 @@
343343
<tr>
344344
<td colspan="2" class="text-end">
345345
{% trans 'User preferences:' %}
346-
{% if relation_parameters.userPreferencesFeature is not null %}
346+
{% if relation_parameters.userconfigwork %}
347347
<span class="text-success">{% trans 'Enabled' %}</span>
348348
{% else %}
349349
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -381,7 +381,7 @@
381381
<tr>
382382
<td colspan="2" class="text-end">
383383
{% trans 'Configurable menus:' %}
384-
{% if relation_parameters.configurableMenusFeature is not null %}
384+
{% if relation_parameters.menuswork %}
385385
<span class="text-success">{% trans 'Enabled' %}</span>
386386
{% else %}
387387
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -406,7 +406,7 @@
406406
<tr>
407407
<td colspan="2" class="text-end">
408408
{% trans 'Hide/show navigation items:' %}
409-
{% if relation_parameters.navigationItemsHidingFeature is not null %}
409+
{% if relation_parameters.navwork %}
410410
<span class="text-success">{% trans 'Enabled' %}</span>
411411
{% else %}
412412
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -431,7 +431,7 @@
431431
<tr>
432432
<td colspan="2" class="text-end">
433433
{% trans 'Saving Query-By-Example searches:' %}
434-
{% if relation_parameters.savedQueryByExampleSearchesFeature is not null %}
434+
{% if relation_parameters.savedsearcheswork %}
435435
<span class="text-success">{% trans 'Enabled' %}</span>
436436
{% else %}
437437
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -446,7 +446,7 @@
446446
{{ show_docu('config', 'cfg_Servers_central_columns') }}
447447
</th>
448448
<td class="text-end">
449-
{% if relation_parameters.centralColumns is not null %}
449+
{% if relation_parameters.central_columns is not null %}
450450
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
451451
{% else %}
452452
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -456,7 +456,7 @@
456456
<tr>
457457
<td colspan="2" class="text-end">
458458
{% trans 'Managing central list of columns:' %}
459-
{% if relation_parameters.centralColumnsFeature is not null %}
459+
{% if relation_parameters.centralcolumnswork %}
460460
<span class="text-success">{% trans 'Enabled' %}</span>
461461
{% else %}
462462
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -471,7 +471,7 @@
471471
{{ show_docu('config', 'cfg_Servers_designer_settings') }}
472472
</th>
473473
<td class="text-end">
474-
{% if relation_parameters.designerSettings is not null %}
474+
{% if relation_parameters.designer_settings is not null %}
475475
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
476476
{% else %}
477477
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -481,7 +481,7 @@
481481
<tr>
482482
<td colspan="2" class="text-end">
483483
{% trans 'Remembering designer settings:' %}
484-
{% if relation_parameters.databaseDesignerSettingsFeature is not null %}
484+
{% if relation_parameters.designersettingswork %}
485485
<span class="text-success">{% trans 'Enabled' %}</span>
486486
{% else %}
487487
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -496,7 +496,7 @@
496496
{{ show_docu('config', 'cfg_Servers_export_templates') }}
497497
</th>
498498
<td class="text-end">
499-
{% if relation_parameters.exportTemplates is not null %}
499+
{% if relation_parameters.export_templates is not null %}
500500
<span class="text-success"><strong>{% trans %}OK{% context %}Correctly working{% endtrans %}</strong></span>
501501
{% else %}
502502
<span class="text-danger"><strong>{% trans 'not OK' %}</strong></span>
@@ -506,7 +506,7 @@
506506
<tr>
507507
<td colspan="2" class="text-end">
508508
{% trans 'Saving export templates:' %}
509-
{% if relation_parameters.exportTemplatesFeature is not null %}
509+
{% if relation_parameters.exporttemplateswork %}
510510
<span class="text-success">{% trans 'Enabled' %}</span>
511511
{% else %}
512512
<span class="text-danger">{% trans 'Disabled' %}</span>
@@ -515,7 +515,7 @@
515515
</tr>
516516
</table>
517517

518-
{% if not relation_parameters.hasAllFeatures() %}
518+
{% if not relation_parameters.allworks %}
519519
<p>{% trans 'Quick steps to set up advanced features:' %}</p>
520520

521521
<ul>

0 commit comments

Comments
 (0)