500 访问 limesurvey 调查令牌管理页面时出现内部服务器错误


500 Internal Server Error while accessing the limesurvey survey token management page

在访问调查令牌管理页面时收到 500 内部服务器错误,并且 apache 错误日志显示,

PHP 致命错误:在非对象上调用成员函数 FetchRow() 在/var/www/html/limesurvey/admin/tokens.php 第 707 行中,引用者: http://****/limesurvey/admin/admin.php?sid=55876.

这是令牌.php行号:707

$tksq = "SELECT count(*) FROM ".db_table_name("tokens_$surveyid")." WHERE (sent!='N' and sent<>'')";
$tksr = db_execute_num($tksq);
while ($tkr = $tksr->FetchRow())
{
    $tokenoutput .= "<th>".$clang->gT("Total invitations sent")."</th><td> $tkr[0] / $tkcount</td></tr><tr>'n";
}

有人可以帮助我解决这个问题吗?

尝试如下:

$surveyid = 55876;
$tablename = db_table_name("tokens_$surveyid");
$tksq = "SELECT count(*) FROM ".$tablename." WHERE (sent!='N' and sent<>'')";

更新到最后一个 2.06 或 2.50 :

  • https://github.com/LimeSurvey/LimeSurvey/blob/2.06lts/application/controllers/admin/tokens.php#L707
  • https://github.com/LimeSurvey/LimeSurvey/blob/master/application/controllers/admin/tokens.php#L707

解决了这个问题,由于调查表崩溃,然后修复了整个数据库。