phpmyadmin / phpmyadmin/phpmyadmin
TypeError: preg_replace(): Argument #3 ($subject) must be of type array|string, null given
Nessuno ha ancora preso questa issue.
- Lingua principale
- PHP
- Stelle
- 7.9k
- Fork
- 3.6k
- Merge medio
- 4g 18h
- PR unite (30g)
- 36
Descrizione
Describe the bug
I have a table that has a JSON type column created on MySQL. If the database is open on MariaDB, it will show the table in use.
Now, if I click on Browse, a #4161 - Unknown data type: 'MYSQL_JSON' error is given. But, if I click on Search, a few errors come up.
5.2.2-dev
TypeError: preg_replace(): Argument #3 ($subject) must be of type array|string, null given
Internal error in .\templates\table\search\index.twig#72 Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Undefined array key 0").```
Warning in .\libraries\classes\Controllers\Table\SearchController.php#346
Undefined array key 0
Warning in .\libraries\classes\Controllers\Table\SearchController.php#347
Undefined array key 0
To Reproduce
Steps to reproduce the behavior:
- Have a table with a
JSONtype column - Open the database on MariaDB
- Click on Search for that table
- See error
Expected behavior
A #4161 - Unknown data type: 'MYSQL_JSON' error should be given, like it happens when you click on Browser Insert.
Screenshots
5.2.2-dev
Server configuration
- phpMyAdmin version: 5.2.2-dev, 6.0.0-dev
Additional context
5.2.2-dev
Warning in .\libraries\classes\Controllers\Table\SearchController.php#346
Undefined array key 0
Backtrace
CoreExtension.php#1635: PhpMyAdmin\Controllers\Table\SearchController->getColumnProperties(
integer 0,
integer 0,
)
89e0cdc4eec79bf3db7e00c4b27a82ac.php#205: twig_get_attribute(
,
,
,
string 'getColumnProperties',
array,
string 'method',
boolean false,
boolean false,
boolean false,
integer 72,
)
Template.php#394: __TwigTemplate_4f09a00a8ff807a41e95ef41004b827a->doDisplay(
array,
array,
)
Template.php#367: Twig\Template->displayWithErrorHandling(
array,
array,
)
Template.php#379: Twig\Template->display(array)
TemplateWrapper.php#40: Twig\Template->render(
array,
array,
)
Template.php#156: Twig\TemplateWrapper->render(array)
AbstractController.php#35: PhpMyAdmin\Template->render(
string 'table/search/index',
array,
)
SearchController.php#292: PhpMyAdmin\Controllers\AbstractController->render(
string 'table/search/index',
array,
)
SearchController.php#204: PhpMyAdmin\Controllers\Table\SearchController->displaySelectionFormAction()
Routing.php#191: PhpMyAdmin\Controllers\Table\SearchController->__invoke(
,
array,
)
index.php#43: PhpMyAdmin\Routing::callControllerForRoute(
,
string '/table/search',
,
,
)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia in libraries/classes/Controllers/Table/SearchController.php intorno alle righe 346–347 e nel template templates/table/search/index.twig alla riga 72. Riproduci il flusso Search con una colonna JSON MySQL aperta tramite MariaDB, quindi traccia le proprietà mancanti della colonna. Il lavoro è completato quando Search segnala l’errore #4161 unknown-data-type previsto invece del TypeError e degli avvisi undefined-array-key.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- mariadb, mysql, php
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100