View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
19904Bug reportsOtherpublic2024-12-19 15:47
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Summary19904: Some global setting must be in 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 heat2
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

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')

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