"display tokens" page empty when there are too many tokens(>15000)

More
5 years 1 month ago - 5 years 1 month ago #85373 by siyang1982
siyang1982 created the topic: "display tokens" page empty when there are too many tokens(>15000)
I import 16366 tokens from csv file.
Evenything works fine now, except when I click "display tokens" to see the list page, it is empty, the list is empty.
But I can export this list to csv file.

Why?

PS:
I find /index.php/admin/tokens/getTokens_json/surveyid/941689 returns 500 error.
But I can't find any error log about it.
In this function, it seems all data was loaded: $tokens = Tokens_dynamic::model($iSurveyId)->findAll(array("order"=>$sidx. " ". $sord));
Last Edit: 5 years 1 month ago by siyang1982.

Please Log in to join the conversation.

More
5 years 1 month ago #85374 by siyang1982
siyang1982 replied the topic: "display tokens" page empty when there are too many tokens(>15000)
I fix this problem through update three lines:

......
/* $tokens = Tokens_dynamic::model($iSurveyId)->findAll(array("order"=>$sidx. " ". $sord)); */
$tokens = Tokens_dynamic::model($iSurveyId)->findAll(array("order"=>$sidx. " ". $sord, "offset"=>($page - 1) * $limit, "limit"=>$limit));
......
/* $aData->records = count($tokens); */
$aData->records = Tokens_dynamic::model($iSurveyId)->count();
......
/* for ($i = 0, $j = ($page - 1) * $limit; $i < $limit && $j < $aData->records; $i++, $j++) */
for ($i = 0, $j = 0; $i < $limit && $j < $limit; $i++, $j++)
......

Please Log in to join the conversation.

More
4 years 3 months ago #97387 by dleger
dleger replied the topic: "display tokens" page empty when there are too many tokens(>15000)
Fairly new on this... But I have the same issue... Only I tried to export about 12500 tokens...

Where are these lines that need to be updated? Which file?

Please Log in to join the conversation.

More
4 years 3 months ago #97390 by siyang1982
siyang1982 replied the topic: "display tokens" page empty when there are too many tokens(>15000)
file: application/controllers/admin/tokens.php
function getTokens_json

I did this in previous version, I'm not sure whether it is working.

Please Log in to join the conversation.

More
4 years 3 months ago #97391 by dleger
dleger replied the topic: "display tokens" page empty when there are too many tokens(>15000)
Thanks. I'm a little frightful to change the code... But maybe someday I'll give it a try when I know usage will be down and I wont have to worry about the system being unavailable for a few hours in case I mess it up.

I did find an alternative this evening, in case anyone else runs into this isssue, which is to query the database directly. I logged into the mysql database and found the tables were actually quite easy to understand, and my web providers interface made it extremely easy to export the tokens file. It came out exactly as it would thru LS. Thanks again.

D.

Please Log in to join the conversation.

More
4 years 3 months ago #97399 by DenisChenu
DenisChenu replied the topic: "display tokens" page empty when there are too many tokens(>15000)
Hello .

Maybe some Session issue: what happens if you deconnect/reconnect and look at token list ?

Can you report the bug : www.limesurvey.org/en/community-services/bug-tracker .

Remind : a bug not reported is a bug no corrected.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 years 3 months ago #97417 by mdekker
mdekker replied the topic: "display tokens" page empty when there are too many tokens(>15000)
I reported and fixed the bug:

bugs.limesurvey.org/view.php?id=7954

---
Menno Dekker
The following user(s) said Thank You: c_schmitz, DenisChenu

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now