Closed txwikinger closed 5 months ago
Describe the bug When using test all terms inside the terms page, an error message and tracback is shown
To Reproduce Steps to reproduce the behavior:
Fatal Error: do_test_test.php called with wrong parameters
Backtrace:
Signal this issue on GitHub or Discord.
Expected behavior I can to the testing pages for the terms
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete) You can copy/paste data from http://[.. your LWT installation]/server_data.php.
<?php
/**
namespace Lwt\Interface\Server\Data;
require_once 'inc/session_utility.php';
@psalm-return array{db_name: string, db_prefix: string, db_size: float, server_soft: string, apache: string, php: false|string, mysql: string} */ function get_server_data_table(): array { global $tbpref, $dbname; $dbaccess_format = convert_string_to_sqlsyntax($dbname); $data_table = array(); $data_table["db_name"] = $dbname; $data_table["db_prefix"] = $tbpref; $temp_size = get_first_value( "SELECT ROUND(SUM(data_length+index_length)/1024/1024, 1) AS value FROM information_schema.TABLES WHERE table_schema = $dbaccess_format AND table_name IN ( '{$tbpref}archivedtexts', '{$tbpref}archtexttags', '{$tbpref}feedlinks', '{$tbpref}languages', '{$tbpref}newsfeeds', '{$tbpref}sentences', '{$tbpref}settings', '{$tbpref}tags', '{$tbpref}tags2', '{$tbpref}textitems2', '{$tbpref}texts', '{$tbpref}texttags', '{$tbpref}words', '{$tbpref}wordtags' )" ); if ($temp_size === null) { $data_table["db_size"] = 0.0; } else { $data_table["db_size"] = floatval($temp_size); }
$data_table["server_soft"] = $_SERVER['SERVER_SOFTWARE']; $data_table["apache"] = "Apache/?"; if (str_starts_with($data_table["server_soft"], "Apache/")) { $temp_soft = explode(' ', $data_table["server_soft"]); $data_table["apache"] = $temp_soft[0]; } $data_table["php"] = phpversion(); $data_table["mysql"] = (string)get_first_value("SELECT VERSION() AS value"); return $data_table; }
@return void */ function display_content(): void { $data = get_server_data_table();
pagestart("Server Data", true); ?>
<?php pageend(); }
display_content();
Desktop (if necessary):
Smartphone (if necessary):
Additional context Add any other context about the problem here.
Hi @txwikinger ! Thank you for the bug report, I fixed it, it was one line of code acting up (missing 's' character at inc/session_utility#L747).
Have a good day!
Describe the bug When using test all terms inside the terms page, an error message and tracback is shown
To Reproduce Steps to reproduce the behavior:
Fatal Error: do_test_test.php called with wrong parameters
Backtrace:
0 /var/www/html/lwt/inc/session_utility.php(782): my_die('...')
1 /var/www/html/lwt/inc/session_utility.php(802): do_test_test_get_projection('...', Array)
2 /var/www/html/lwt/do_test.php(62): do_test_test_from_selection(2, '...')
3 /var/www/html/lwt/do_test.php(187): get_l2_language_name()
4 /var/www/html/lwt/do_test.php(260): do_test_desktop_page()
5 /var/www/html/lwt/do_test.php(277): do_test_page('...')
6 /var/www/html/lwt/do_test.php(285): try_start_test('...')
Signal this issue on GitHub or Discord.
Expected behavior I can to the testing pages for the terms
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete) You can copy/paste data from http://[.. your LWT installation]/server_data.php.
<?php
/**
namespace Lwt\Interface\Server\Data;
require_once 'inc/session_utility.php';
/**
@psalm-return array{db_name: string, db_prefix: string, db_size: float, server_soft: string, apache: string, php: false|string, mysql: string} */ function get_server_data_table(): array { global $tbpref, $dbname; $dbaccess_format = convert_string_to_sqlsyntax($dbname); $data_table = array(); $data_table["db_name"] = $dbname; $data_table["db_prefix"] = $tbpref; $temp_size = get_first_value( "SELECT ROUND(SUM(data_length+index_length)/1024/1024, 1) AS value FROM information_schema.TABLES WHERE table_schema = $dbaccess_format AND table_name IN ( '{$tbpref}archivedtexts', '{$tbpref}archtexttags', '{$tbpref}feedlinks', '{$tbpref}languages', '{$tbpref}newsfeeds', '{$tbpref}sentences', '{$tbpref}settings', '{$tbpref}tags', '{$tbpref}tags2', '{$tbpref}textitems2', '{$tbpref}texts', '{$tbpref}texttags', '{$tbpref}words', '{$tbpref}wordtags' )" ); if ($temp_size === null) { $data_table["db_size"] = 0.0; } else { $data_table["db_size"] = floatval($temp_size); }
$data_table["server_soft"] = $_SERVER['SERVER_SOFTWARE']; $data_table["apache"] = "Apache/?"; if (str_starts_with($data_table["server_soft"], "Apache/")) { $temp_soft = explode(' ', $data_table["server_soft"]); $data_table["apache"] = $temp_soft[0]; } $data_table["php"] = phpversion(); $data_table["mysql"] = (string)get_first_value("SELECT VERSION() AS value"); return $data_table; }
/**
@return void */ function display_content(): void { $data = get_server_data_table();
pagestart("Server Data", true); ?>
Server
Database
Client API
<?php pageend(); }
display_content();
Desktop (if necessary):
Smartphone (if necessary):
Additional context Add any other context about the problem here.