Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Search Results (Searched for: n/a)

  • linuxhooligan
  • linuxhooligan's Avatar
08 Jul 2023 07:12 - 08 Jul 2023 07:14
Creating a new theme based on a core theme was created by linuxhooligan
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.1.6+230703
Own server or LimeSurvey hosting: own server
Survey theme/template: n/a
==================

Hi guys.

I have googled this and read the manuals and I am absolutely baffled by the process to create a new theme. 

Details:

The manuals say to go into theme editor and it says there is supposed to be a button labeled "CREATE".  Well, there is no such button.  I only see EXPORT, EXTEND and DELETE.  I don't understand what is going on here.  Link to manual page: manual.limesurvey.org/Theme_editor

I tried exporting the Bootswach theme, renaming the zip file and importing it but the import is only PARTIAL and it will skip importing a whole bunch of files.

I also tried editing the config.xml file to change the name, version, etc., zip it up,but it failed to install as well.

This is kind of frustrating because I don't understand the discrepancy between what I am reading in the manuals versus what I am seeing in 6.1.6. 

QUESTION: What is the proper methodology for taking an existing core theme, duplicating it and installing it in the same running LS install?

USECASE: I don't want to extend a theme, I really don't like dependencies between themes.  I want a theme to be completely isolated from other themes so I can make mistakes without the issue of tracking down what is propagating and what isn't.

ATTACHED: Screenshot of my theme editor menu.

Any suggestions are greatly appreciated.  Thanks!

 
  • mferraz
  • mferraz's Avatar
15 Jun 2023 18:52
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.1.3+230612 
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi

I'm trying to implement the following code to Authenticate users using Shibboleth like we used to do on version 3, but I'm getting the following error when I've tried to test the shibd user variable:PHP warningUndefined array key "eppn"/opt/limesurvey/plugins/AuthAAI/AuthAAI.php(20)08 public $allowedPublicMethods = array();
09
10 public function init()
11 {
12 // Registra os eventos que o plugin vai escutar
13 $this->subscribe('beforeLogin');
14 $this->subscribe('newUserSession');
15
16 }
17
18 public function beforeLogin()
19 {
20 echo $_SERVER;
21 // Verifica se a variável $_SERVER existe
22 if (isset($_SERVER)) {
23 // Usa a variável como username
24 $username = $_SERVER;
25 // Tenta encontrar o utilizador no banco de dados
26 $user = $this->api->getUserByName($username);
27 if ($user === null) {
28 // Se o utilizador não existe, cria um novo com permissão de participante
29 $user = new User;
30 $user->users_name = $username;
31 $user->password = hash('sha256', createPassword());
32 $user->full_name = $_SERVER;
Stack Trace#0 unknown(0): AuthAAI->beforeLogin()#1–
  /opt/limesurvey/application/libraries/PluginManager/PluginManager.php(269): call_user_func(array(AuthAAI, "beforeLogin"))264 if (
265 !$event->isStopped()
266 && (empty($target) || in_array(get_class($subscription[0]), $target))
267 ) {
268 $subscription[0]->setEvent($event);
269 call_user_func($subscription);
270 }
271 }
272 }
273
274 return $event;
#2–
  /opt/limesurvey/application/controllers/admin/Authentication.php(111): LimeSurvey\PluginManager\PluginManager->dispatchEvent(PluginEvent)106 // In Authdb, the plugin event "beforeLogin" checks if the url param "onepass" is set
107 // if yes, it will call AuthPluginBase::setAuthPlugin to set to true the plugin private parameter "_stop", so the form will not be displayed
108 // @see: application/core/plugins/Authdb/Authdb.php: function beforeLogin()
109 $beforeLogin = new PluginEvent('beforeLogin');
110 $beforeLogin->set('identity', new LSUserIdentity('', ''));
111 App()->getPluginManager()->dispatchEvent($beforeLogin);
112
113 /* @var $identity LSUserIdentity */
114 $identity = $beforeLogin->get('identity'); // Why here?
115
116 // If the plugin private parameter "_stop" is false and the login form has not been submitted: render the login form
#3–
  /opt/limesurvey/application/controllers/admin/Authentication.php(47): Authentication::prepareLogin()42 }
43 // The page should be shown only for non logged in users
44 $this->redirectIfLoggedIn();
45
46 // Result can be success, fail or data for template
47 $result = self::prepareLogin();
48
49 $isAjax = isset($_GET) && $_GET == 1;
50 $succeeded = isset($result[0]) && $result[0] == 'success';
51 $failed = isset($result[0]) && $result[0] == 'failed';
52
#4 unknown(0): Authentication->index()#5+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/actions/CAction.php(115): ReflectionMethod->invokeArgs(Authentication, array())#6+
  /opt/limesurvey/application/core/SurveyCommonAction.php(83): CAction->runWithParamsInternal(Authentication, ReflectionMethod, array("sa" => "login"))#7+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/CController.php(308): SurveyCommonAction->runWithParams(array("sa" => "login"))#8+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/CController.php(286): CController->runAction(Authentication)#9+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/CController.php(265): CController->runActionWithFilters(Authentication, array())#10+
  /opt/limesurvey/application/controllers/AdminController.php(202): CController->run("authentication")#11+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/CWebApplication.php(282): AdminController->run("authentication")#12+
  /opt/limesurvey/vendor/yiisoft/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/authentication/sa/login")#13+
  /opt/limesurvey/vendor/yiisoft/yii/framework/base/CApplication.php(185): CWebApplication->processRequest()#14+
  /opt/limesurvey/index.php(161): CApplication->run()
This is the code:
<?php
// Plugin para autenticação federada shibboleth para o limesurvey
class AuthAAI extends AuthPluginBase
{
    protected $storage = 'DbStorage';
    static protected $description = 'Autenticação federada shibboleth';
    static protected $name = 'AuthAAI';
    public function init()
    {
        // Registra os eventos que o plugin vai escutar
        $this->subscribe('beforeLogin');
        $this->subscribe('newUserSession');

    }

    public function beforeLogin()
    {
    echo $_SERVER; //for testing
        // Verifica se a variável $_SERVER existe
        if (isset($_SERVER)) {
            // Usa a variável como username
            $username = $_SERVER;
            // Tenta encontrar o utilizador no banco de dados
            $user = $this->api->getUserByName($username);
            if ($user === null) {
                // Se o utilizador não existe, cria um novo com permissão de participante
                $user = new User;
                $user->users_name = $username;
                $user->password = hash('sha256', createPassword());
                $user->full_name = $_SERVER;
                $user->parent_id = 1;
                $user->lang = 'pt-PT';
                $user->email = $_SERVER;
                if ($user->save()) {
                    // Atribui a permissão de participante ao utilizador
                    Permission::model()->setGlobalPermission($user->uid, 'surveys', array('create_p'));
                    // Dispara o evento de novo utilizador
                    $this->getEvent()->set('newUser', true);
                } else {
                    // Se houver algum erro ao salvar o utilizador, mostra uma mensagem de erro
                    $this->getEvent()->set('error', 'Não foi possível criar o utilizador.');
                }
            }
            // Se o utilizador existe, autentica
            if ($user !== null) {
                // Dispara o evento de nova sessão de utilizador
        $this->setUsername($user);
                $this->setAuthSuccess($user);
            $this->setAuthPlugin(); // This plugin will handle authentication and skips the login form
            }
        } else {
            // Se a variável não existe, mostra uma mensagem de erro
            $this->getEvent()->set('error', 'Não foi possível obter a variável $_SERVER[\'eppn\'].');
        }
    }

    public function newUserSession()
    {
        // Obtém o utilizador autenticado
        $user = $this->getEvent()->get('user');
        if ($user !== null) {
            // Atualiza a última data de login do utilizador
            $user->setAttributes(array('last_login' => date('Y-m-d H:i:s')));
            $user->save();
        }
    }
}

I've tried the same echo, even with a function on the same Limesurvey parent directory, and I'm getting the variable just fine.

Thank you in advance.
  • chaoty2k
  • chaoty2k's Avatar
13 Jun 2023 12:13
SQLSTATE[HY000]: General error, was created by chaoty2k
Please help us help you and fill where relevant:
Your LimeSurvey version: today downloaded
Own server or LimeSurvey hosting: own server
Survey theme/template: n/a
==================
hi,

i am trying to install at a vm that uses an azure Mysql-Database.

Login-Creds for mysql are correct, database is created, but then
  • CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[HY000]: General error: 1030 Got error 1 from storage engine

already enabled debug and sql debug but it looks like being ignored at installation?

any ideas what i could do?
 
  • LarryF
  • LarryF's Avatar
17 May 2023 14:09 - 17 May 2023 17:15
Here is the result of the debug mode during the second import.
I have also attached an "emptied" version of the survey that still causes the error.

File Attachment:

File Name: limesurvey...rvey.lss
File Size:71 KB


ExceptionErreur: Failed to import survey language settings - data is invalid./var/www/html/survey/application/helpers/admin/import_helper.php(1423)1411 }
1412
1413 if (isset($insertdata) && substr($insertdata, 0, 1) != '{') {
1414 unset($insertdata);
1415 }
1416 $aColumns = SurveyLanguageSetting::model()->attributes;
1417 $insertdata = array_intersect_key($insertdata, $aColumns);
1418
1419 $surveyLanguageSetting = new SurveyLanguageSetting();
1420 $surveyLanguageSetting->setAttributes($insertdata, false);
1421 try {
1422 if (!$surveyLanguageSetting->save()) {
1423 throw new Exception(gT("Error") . ": Failed to import survey language settings - data is invalid.");
1424 }
1425 } catch (CDbException $e) {
1426 throw new Exception(gT("Error") . ": Failed to import survey language settings - data is invalid.");
1427 }
1428 }
1429
1430
1431 // Import groups table ===================================================================================
1432 if (isset($xml->groups->rows->row)) {
1433 foreach ($xml->groups->rows->row as $row) {
1434 $insertdata = array();
1435 foreach ($row as $key => $value) {
Stack Trace#0– /var/www/html/survey/application/helpers/admin/import_helper.php(1140): XMLImportSurvey()1135 } else {
1136 $sExtension = "";
1137 }
1138 switch ($sExtension) {
1139 case 'lss':
1140 $aImportResults = XMLImportSurvey($sFullFilePath, null, $sNewSurveyName, $DestSurveyID, $bTranslateLinksFields);
1141 if (!empty($aImportResults)) {
1142 $SurveyIntegrity = new LimeSurvey\Models\Services\SurveyIntegrity(Survey::model()->findByPk($aImportResults));
1143 $SurveyIntegrity->fixSurveyIntegrity();
1144 }
1145 return $aImportResults;
#1– /var/www/html/survey/application/controllers/SurveyAdministrationController.php(2159): importSurveyFile()2154
2155 // Now, we have the survey : start importing
2156 Yii::app()->loadHelper('admin/import');
2157
2158 if ($action == 'importsurvey' && !$aData) {
2159 $aImportResults = importSurveyFile($sFullFilepath, (Yii::app()->request->getPost('translinksfields') == '1'));
2160 if (is_null($aImportResults)) {
2161 $aImportResults = array(
2162 'error' => gT("Unknown error while reading the file, no survey created.")
2163 );
2164 }
#2+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/actions/CInlineAction.php(49): SurveyAdministrationController->actionCopy() #3+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/CController.php(308): CInlineAction->runWithParams() #4+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/CController.php(286): CController->runAction() #5+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/CController.php(265): CController->runActionWithFilters() #6– /var/www/html/survey/application/controllers/LSBaseController.php(145): CController->run()140 $this->redirect(array('/admin/authentication/sa/login'));
141 }
142 }
143 }
144
145 parent::run($action);
146 }
147
148 /**
149 * Load and set session vars
150 *
#7+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/CWebApplication.php(282): LSBaseController->run() #8+ /var/www/html/survey/vendor/yiisoft/yii/framework/web/CWebApplication.php(141): CWebApplication->runController() #9+ /var/www/html/survey/vendor/yiisoft/yii/framework/base/CApplication.php(185): CWebApplication->processRequest() #10+ /var/www/html/survey/index.php(192): CApplication->run()
  • Saschab0508
  • Saschab0508's Avatar
08 May 2023 10:05
Bitte helfen Sie uns, Ihnen zu helfen und füllen Sie folgende Felder aus:
Ihre LimeSurvey-Version: 3.28.54
Eigener Server oder LimeSurvey-Cloud: LimeSurvey-Cloud
Genutzte Designvorlage: Lime Survey Fruity Theme
==================
Hallo Zusammen,

ich stehe vor folgender Herausforderung,

Es soll erfragt werden welche Hardware jemand nutzt.
Es gibt hierbei die Option mehrere Antworten zu geben. Dies ist ja bis dato auch noch einfach umsetzbar.
Jedoch soll wenn jemand einen Haken setzt direkt darunter 3 weitere Fragen gestellt werden.
Zwei Listenfragen und eine Textfrage.

Diese Weiteren Fragen sollen aber unter jeder möglichen Antwort Option auftauchen/aufklappen können.
Also eine mehrfach Nutzung dieser Fragen welche ich auch separat auswerten kann.


Also Wählt man in Frage 1
  1. A
  2. B
  3. C
  4. D
  5. E
  6. F

Dann soll wenn man B zum Beispiel wählt direkt in den Antwortmöglichkeiten unter B die weiteren erstellten Fragen auftauchen/aufklappen.
Wählt man Zusätzlich auch D dann sollen unter D auch diese Fragen zusätzlich auftauchen/aufklappen.

Ich hoffe Meine Anfrage wurde verständlich gestellt.
Ich weiß das man dies nur mit Bedingungen regeln kann. Aber ist dies möglich diese auch in die Antworten (Bzw weiteren Fragen) direkt zu integrieren?
Ich bitte hier um Hilfe.

Vielen Dank und liebe Grüße
Sascha
  • DenisChenu
  • DenisChenu's Avatar
03 May 2023 18:09

Hello,
person responsible for the installation here.

Indeed with LS5 we switched the database engine to InnoDB. It is very hard to find good reasons for still using MyISAM in 2023, especially in a larger scaled environment.

The error message seems a bit misleading: In fact the row size gets too large, which can be caused by too many columns, true, but the amount of columns is not the troublemaker in that case though.

What would be best practice? Mixing database engines? Updating the migration scripts with something like
Code:
ALTER TABLE survey_123 ROW_FORMAT=DYNAMIC;
to bypass the problem?

Best regards,
Frank
 
In 3.X : we use InnoDB for internal table (survey/question/answer etc …) but MyIsam for survey table.

If you know some options that can be great to add it
You can test on
github.com/LimeSurvey/LimeSurvey/blob/a1...eyActivator.php#L321

www.yiiframework.com/doc/api/1.1/CDbSchema#createTable-detail $options is added after the CREATE TABLE instruction

And it's best to have a issue reported about a solution if adding
Code:
ROW_FORMAT=DYNAMIC; allow to create the survey : it's great :) (if it don't broke something else
)
Displaying 61 - 66 out of 66 results.

Lime-years ahead

Online-surveys for every purse and purpose