[6.0]: Uncaught TypeError: can't access property "value", event.chart.scales.x.ticks[4] is undefined

Aperta Adatta ai principianti
#20,626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
chart.js, javascript

Direzione di ricerca

Inizia dal gestore del clic in js/server/status/monitor.js (frame dello stack onClick, intorno alla riga 1333), che legge event.chart.scales.x.ticks[0] e ticks[4] senza verificare che esistano. Controlla lì quanti tick ha il grafico quando Chart columns è impostato a 6 e Refresh rate a 20 minutes. È completato quando il clic su un tick non genera più un errore e la finestra di dialogo log analyse si apre con un intervallo di date sensato, anche quando sono presenti meno di cinque tick.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug
Describe the bug

Uncaught TypeError: can't access property "value", event.chart.scales.x.ticks[4] is undefined when clicking on a chart in Monitor.

How to Reproduce
  1. Go to https://demo.phpmyadmin.net/master-config/public/index.php?route=/server/status/monitor
  2. Click on Settings
  3. Select 20 minutes from Refresh rate
  4. Select 6 from Chart columns
  5. Refresh page
  6. Click on a tick on the chart
  7. See error
Screenshots

https://github.com/user-attachments/assets/58bbc0de-f394-4332-8bbf-0ebd27e5cdfe

phpMyAdmin version

6.0.0-dev+20261113.f4aeb7801c

Additional context
{
    "pma_version": "6.0.0-dev+20261113.f4aeb7801c",
    "browser_name": "FIREFOX",
    "browser_version": "161.0",
    "user_os": "Win",
    "server_software": "nginx/1.26.3",
    "user_agent_string": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:161.0) Gecko/20100101 Firefox/161.0",
    "locale": "en",
    "configuration_storage": "disabled",
    "php_version": "8.2.35",
    "script_name": "index.php",
    "exception_type": "js",
    "exception": {
        "mode": "stack",
        "name": "TypeError",
        "message": "can't access property \"value\", event.chart.scales.x.ticks[4] is undefined",
        "stack": [
            {
                "func": "onClick",
                "line": "1333",
                "column": "36",
                "context": [
                    "            return;",
                    "          }",
                    "          // @ts-ignore",
                    "          const minDate = new Date(event.chart.scales.x.ticks[0].value);",
                    "          // @ts-ignore",
                    "          const maxDate = new Date(event.chart.scales.x.ticks[4].value);",
                    "          getLogAnalyseDialog(minDate, maxDate);",
                    "        }",
                    "      }",
                    "    });",
                    "    if (initialize !== true) {"
                ],
                "uri": "js/server/status/monitor.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/server/status/monitor.js"
            },
            {
                "func": "d",
                "line": "7",
                "column": "1113",
                "context": [
                    " * Chart.js v4.6.1",
                    " * https://www.chartjs.org",
                    " * (c) 2026 Chart.js Contributors",
                    " * Released under the MIT License",
                    " */",
                    "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.//...",
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License"
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            },
            {
                "func": "_handleEvent",
                "line": "13",
                "column": "103528",
                "context": [
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License",
                    " */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e)//...",
                    "//# sourceMappingURL=chart.umd.js.map",
                    ""
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            },
            {
                "func": "_eventHandler",
                "line": "13",
                "column": "103158",
                "context": [
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License",
                    " */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e)//...",
                    "//# sourceMappingURL=chart.umd.js.map",
                    ""
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            },
            {
                "func": "s",
                "line": "13",
                "column": "101097",
                "context": [
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License",
                    " */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e)//...",
                    "//# sourceMappingURL=chart.umd.js.map",
                    ""
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            },
            {
                "func": "ks/n<",
                "line": "13",
                "column": "44327",
                "context": [
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License",
                    " */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e)//...",
                    "//# sourceMappingURL=chart.umd.js.map",
                    ""
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            },
            {
                "func": "ct/</<",
                "line": "7",
                "column": "5542",
                "context": [
                    " * Chart.js v4.6.1",
                    " * https://www.chartjs.org",
                    " * (c) 2026 Chart.js Contributors",
                    " * Released under the MIT License",
                    " */",
                    "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.//...",
                    "/*!",
                    " * @kurkle/color v0.3.2",
                    " * https://github.com/kurkle/color#readme",
                    " * (c) 2023 Jukka Kurkela",
                    " * Released under the MIT License"
                ],
                "uri": "js/vendor/chart.umd.js?v=6.0.0-dev%2B20261113.f4aeb7801c",
                "scriptname": "js/vendor/chart.umd.js"
            }
        ],
        "uri": "index.php?route=%2Fserver%2Fstatus%2Fmonitor"
    }
}
Lingua principale
PHP
Stelle
8k
Fork
3.6k
Merge medio
1g 4h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di phpmyadmin/phpmyadmin

Tutte le issue di phpmyadmin/phpmyadmin

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.