View Issue Details

This bug affects 1 person(s).
 14
IDProjectCategoryView StatusLast Update
19904Bug reportsOtherpublic2025-02-20 10:21
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Summary19904: last question and last_survey are part of user settings
Description

lastsurvey and last_question must be in UserSettings : with a lot of user : you get a lot of not needed line call : memory and time issue.

Steps To Reproduce

Steps to reproduce

Check if global settings contains only global settings (no user setting)

Expected result

No

Actual result

Found last_survey_1 and lasy_question_1_1234

(Write here what happened instead)

TagsNo tags attached.
Bug heat14
Complete LimeSurvey version number (& build)6.8.2
I will donate to the project if issue is resolved
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Relationships

has duplicate 16687 closedDenisChenu App()->config can be really big 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2024-12-19 15:41

developer   ~81675

www:application$ grep -r "last_survey" *
commands/WipeCommand.php:            $actquery = "delete from {{settings_global}} where stg_name LIKE 'last_survey%'";
commands/DemomodeCommand.php:        $actquery = "delete from {{settings_global}} where stg_name LIKE 'last_survey%'";
config/config-defaults.php:$config['show_last_survey_and_question'] = 'show';
controllers/SurveyAdministrationController.php:        SettingGlobal::setSetting('last_survey_' . $userId, $iSurveyID);
controllers/DashboardController.php:        $setting_entry = 'last_survey_' . App()->user->getId();
controllers/DashboardController.php:        $aData['bShowLastSurveyAndQuestion'] = (App()->getConfig('show_last_survey_and_question') == "show");
controllers/HomepageSettingsController.php:            'bShowLastSurveyAndQuestion' => App()->getConfig('show_last_survey_and_question') == "show",
controllers/HomepageSettingsController.php:     * Performs the AJAX toggle of show_last_survey_and_question setting
controllers/HomepageSettingsController.php:            $bNewShowLastSurveyAndQuestion = (App()->getConfig('show_last_survey_and_question') == "show") ? "d-none" : "show";
controllers/HomepageSettingsController.php:            SettingGlobal::setSetting('show_last_survey_and_question', $bNewShowLastSurveyAndQuestion);
views/dashboard/welcome.php:                <div id="last_survey" class=""> <!-- to enable rotation again set class back to "rotateShown" -->
views/homepageSettings/index.php:                            'name'          => 'show_last_survey_and_question',
views/homepageSettings/index.php:                        <input type="hidden" id="show_last_survey_and_question-url" data-url="<?php echo App()->createUrl('homepageSettings/toggleShowLastSurveyAndQuestion'); ?>"/>
www:application$ grep -r "last_question" *
commands/WipeCommand.php:            $actquery = "delete from {{settings_global}} where stg_name LIKE 'last_question%'";
commands/DemomodeCommand.php:        $actquery = "delete from {{settings_global}} where stg_name LIKE 'last_question%'";
controllers/SurveyAdministrationController.php:        $lastquestion = getGlobalSetting('last_question_' . $userId . '_' . $iSurveyID);
controllers/SurveyAdministrationController.php:        $lastquestiongroup = getGlobalSetting('last_question_' . $userId . '_' . $iSurveyID . '_gid');
controllers/SurveyAdministrationController.php:            $aData['last_question_name'] = $qrrow['title'];
controllers/SurveyAdministrationController.php:                $aData['last_question_name'] .= ' : ' . $qrrow->questionl10ns[$baselang]['question'];
controllers/SurveyAdministrationController.php:            $aData['last_question_link'] =
controllers/SurveyAdministrationController.php:        $setting_entry = 'last_question_' . Yii::app()->user->getId() . '_' . $iSurveyID;
controllers/SurveyAdministrationController.php:        $setting_entry = 'last_question_' . Yii::app()->user->getId() . '_' . $iSurveyID . '_gid';
controllers/DashboardController.php:        $setting_entry = 'last_question_' . App()->user->getId();
controllers/DashboardController.php:        $setting_entry = 'last_question_gid_' . App()->user->getId();
controllers/DashboardController.php:        // the sid of this question : last_question_sid_1
controllers/DashboardController.php:        $setting_entry = 'last_question_sid_' . App()->user->getId();
controllers/DashboardController.php:                    $aData['last_question_name'] = $qrrow['title'];
controllers/DashboardController.php:                        $aData['last_question_name'] .= ' : ' . $qrrow->questionl10ns[$baselang]['question'];
controllers/DashboardController.php:                    $aData['last_question_link'] = $this->createUrl("questionAdministration/view/surveyid/$sid/gid/$gid/qid/$qid");
models/Question.php:        $oCriteria->compare('stg_name', 'last_question_%', true, 'AND', false);
models/Survey.php:            $oCriteria->compare('stg_name', 'last_question_gid_%', true, 'AND', false);
models/Survey.php:            $oCriteria->compare('stg_name', 'last_question_%', true, 'OR', false);
views/dashboard/welcome.php:                <div id="last_question" class=""> <!-- to enable rotation again set class back to "rotateHidden" -->
views/dashboard/welcome.php:                    <a href="<?php echo $last_question_link; ?>">
views/dashboard/welcome.php:                        <?= viewHelper::flatEllipsizeText($last_question_name, true, 60) ?>
DenisChenu

DenisChenu

2024-12-19 15:44

developer   ~81676

All global settings go in config variable at start !
When you have more than 1000 user : 3000 lines (or more ?) loaded each calls

I move it to bug

DenisChenu

DenisChenu

2024-12-19 15:47

developer   ~81677

Last edited: 2024-12-19 15:47

Each call of limesurvey start by system.db.CDbCommand.query(SELECT * FROM lime_settings_global' 't')

DenisChenu

DenisChenu

2025-02-18 19:05

developer   ~82081

All of this are deprecated : we don't save last survey and last question now …

DenisChenu

DenisChenu

2025-02-19 12:03

developer   ~82082

Last edited: 2025-02-19 12:17

All feature seems deprecated : 2 solution

  1. Delete whole system
  2. Fix it (currently : lastsurvey and lasquestions are loaded, but never save

I try with 'display_old_dashboard' => 1 in config.php : still the new one.

@tibor.pacalat ?

c_schmitz

c_schmitz

2025-02-19 12:24

administrator   ~82083

Last edited: 2025-02-19 12:24

  • Delete all last_* entries from global settings using a dbversion update
  • Fix existing code to load from settings_user, instead
Mazi

Mazi

2025-02-19 12:54

updater   ~82084

Please keep this feature, it is really helpful when working with Limesurvey.

DenisChenu

DenisChenu

2025-02-19 15:43

developer   ~82091

Ok, then need to fix : save the current survey and question (it's not the case today)

DenisChenu

DenisChenu

2025-02-20 07:53

developer   ~82097

OK ! I don't check the option … it works partially for survey, never for question

Issue History

Date Modified Username Field Change
2024-12-19 15:40 DenisChenu New Issue
2024-12-19 15:41 DenisChenu Note Added: 81675
2024-12-19 15:41 DenisChenu Bug heat 0 => 2
2024-12-19 15:44 DenisChenu Note Added: 81676
2024-12-19 15:44 DenisChenu Project Development => Bug reports
2024-12-19 15:46 DenisChenu Description Updated
2024-12-19 15:46 DenisChenu Complete LimeSurvey version number (& build) => 6.8.2
2024-12-19 15:46 DenisChenu Browser => not relevant
2024-12-19 15:46 DenisChenu Database type & version => not relevant
2024-12-19 15:46 DenisChenu Server OS (if known) => not relevant
2024-12-19 15:46 DenisChenu Webserver software & version (if known) => not relevant
2024-12-19 15:46 DenisChenu PHP Version => not relevant
2024-12-19 15:47 DenisChenu Note Added: 81677
2024-12-19 15:47 DenisChenu File Added: Capture d’écran du 2024-12-19 15-44-39.png
2024-12-19 15:47 DenisChenu Note Edited: 81677
2025-02-18 17:05 DenisChenu Assigned To => DenisChenu
2025-02-18 17:05 DenisChenu Status new => assigned
2025-02-18 17:06 DenisChenu Relationship added has duplicate 16687
2025-02-18 17:06 DenisChenu Bug heat 2 => 10
2025-02-18 19:05 DenisChenu Note Added: 82081
2025-02-19 12:03 DenisChenu Note Added: 82082
2025-02-19 12:04 DenisChenu Summary Some global setting must be in User settings => lastsurvey and lastquestions are deprecated and consumes database time, memory and computation time for nothing.
2025-02-19 12:15 DenisChenu Summary lastsurvey and lastquestions are deprecated and consumes database time, memory and computation time for nothing. => last_survey_ and last_questions_ are deprecated
2025-02-19 12:15 DenisChenu Note Edited: 82082
2025-02-19 12:17 DenisChenu Note Edited: 82082
2025-02-19 12:24 c_schmitz Note Added: 82083
2025-02-19 12:24 c_schmitz Bug heat 10 => 12
2025-02-19 12:24 c_schmitz Note Edited: 82083
2025-02-19 12:54 Mazi Note Added: 82084
2025-02-19 12:54 Mazi Bug heat 12 => 14
2025-02-19 15:43 DenisChenu Note Added: 82091
2025-02-19 18:08 DenisChenu Summary last_survey_ and last_questions_ are deprecated => Last survey and last question are not shown in 6.X version
2025-02-20 07:53 DenisChenu Note Added: 82097
2025-02-20 10:21 DenisChenu Summary Last survey and last question are not shown in 6.X version => last question and last_survey are part of user settings