|
Hey, and thanks for report.
Can you please tell us how you try to create the question?
There are four ways:
1) Structure -> Add question
2) Click on group -> Add question (quick action button)
3) List questions (left side bar) -> Add question
4) List groups (left side bar) -> Add question from the action column (on the same line with the name of the group) |
|
aschwey
2021-01-29 17:36
reporter
~61808
Last edited: 2021-01-30 17:34
|
Hello cdorin,
Sure I used option : 2) (as on the joined screenshot) Click on group -> Add question (quick action button) -> I get the 500: Internal Server Error syntax error, unexpected '='
But:
When I use option : 1) Structure -> Add question -> the browser tab stuck.
When I use option : 3) List questions (left side bar) -> Add question -> the browser tab stuck.
When I use option : 4) -> I get the 500: Internal Server Error syntax error, unexpected '=' |
|
cdorin
2021-01-29 17:44
reporter
~61809
Last edited: 2021-01-30 17:34
|
Can you enable debug mode ( debug=2) from config.php ? |
|
aschwey
2021-01-29 18:15
reporter
~61810
Last edited: 2021-01-30 17:34
|
Ok I set the debug mode as requested:
// debug: Set this to 1 if you are looking for errors. If you still get no errors after enabling this
// then please check your error-logs - either in your hosting provider admin panel or in some /logs directory
// on your webspace.
// LimeSurvey developers: Set this to 2 to additionally display STRICT PHP error messages and get full access to standard templates
'debug'=>2,
'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2
// Mysql database engine (INNODB|MYISAM): |
|
aschwey
2021-01-29 18:35
reporter
~61811
Last edited: 2021-01-30 17:34
|
Hello cdorin,
I used option 2 and got :
ParseError
syntax error, unexpected '='
/srv/www/htdocs/limesurvey4/application/controllers/QuestionAdministrationController.php(769)
757
758 // TODO: Fix question type 'A'. Needed?
759 $oQuestion = $this->getQuestionObject($qid, 'A', $gid);
760 $oSubquestion = $oQuestion->getEmptySubquestion();
761 $oSubquestion->qid = $qid; // Set qid as new12345 random id.
762
763 //Capture "true" and "false" as strings
764 if (is_string($first)) {
765 $first = $first == "false" ? false : true;
766 }
767
768 $stringCodes = json_decode($codes, true);
769 [$oSubquestion->title, $newPosition] = $this->calculateNextCode($stringCodes);
770
771 $activated = false; // You can't add ne subquestion when survey is active
772 Yii::app()->loadHelper('admin/htmleditor'); // Prepare the editor helper for the view
773
774 $view = 'subquestionRow.twig';
775 $aData = array(
776 'position' => $position,
777 'scale_id' => $scale_id,
778 'activated' => $activated,
779 'first' => $first,
780 'surveyid' => $surveyid,
781 'gid' => $gid,
Stack Trace
#0
– /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(276): CWebApplication->createController("view/")
271 @param string $route the route of the current request. See {@link createController} for more details.
272 @throws CHttpException if the controller could not be created.
273 */
274 public function runController($route)
275 {
276 if(($ca=$this->createController($route))!==null)
277 {
278 list($controller,$actionID)=$ca;
279 $oldController=$this->_controller;
280 $this->_controller=$controller;
281 $controller->init();
#1
– /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(141): CWebApplication->runController("questionAdministration/view")
136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
137 $_GET[$name]=$value;
138 }
139 else
140 $route=$this->getUrlManager()->parseUrl($this->getRequest());
141 $this->runController($route);
142 }
143
144 /*
145 Registers the core application components.
146 * This method overrides the parent implementation by registering additional core components.
#2
– /srv/www/htdocs/limesurvey4/framework/base/CApplication.php(185): CWebApplication->processRequest()
180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /**
#3
– /srv/www/htdocs/limesurvey4/index.php(182): CApplication->run()
177 require_once APPPATH . 'core/LSYii_Application' . EXT;
178
179 $config = require_once(APPPATH . 'config/internal' . EXT);
180
181 Yii::$enableIncludePath = false;
182 Yii::createApplication('LSYii_Application', $config)->run();
183
184 / End of file index.php /
185 / Location: ./index.php /
2021-01-29 18:29:28 Apache Yii Framework/1.1.22-dev |
|
|
769 [$oSubquestion->title, $newPosition] = $this->calculateNextCode($stringCodes);
PHP 7.0 compatibiity ? |
|
aschwey
2021-01-30 12:20
reporter
~61818
Last edited: 2021-01-30 17:34
|
Sorry Denis,
I don't understand what you mean ?
Our php version is 7.0.7
The minimum set of requirements is
https://manual.limesurvey.org/Installation_-_LimeSurvey_CE#General:
Minimum 250 MB disk space.
MySQL 5.5.3 or later OR Microsoft SQL Server 2005 or later OR Postgres 9 or later.
Minimum PHP 7.0 or later; however, we recommend PHP 7.4 with the following modules/libraries enabled |
|
|
It's a dev note : maybe it's a PHP 7 compat issue. And we must fix it in core :) |
|
cdorin
2021-01-30 17:34
reporter
~61821
Last edited: 2021-01-30 17:34
|
Yes, I can reproduce it with php 7.0 . Thanks, @DenisChenu |
|
|
PR: https://github.com/LimeSurvey/LimeSurvey/pull/1753 |
|
|
Hello gabrieljenik,
Thanks for your support. I changed the 2 lines . I can use 1) Structure -> Add question, but unfortunately when I save the question i got this first error but the question is saved :
PHP notice
Undefined index: script
/srv/www/htdocs/limesurvey4/application/controllers/QuestionAdministrationController.php(2489)
2477 */
2478 private function applyL10n($oQuestion, $dataSet)
2479 {
2480 foreach ($dataSet as $sLanguage => $aI10NBlock) {
2481 $i10N = QuestionL10n::model()->findByAttributes(['qid' => $oQuestion->qid, 'language' => $sLanguage]);
2482 if (empty($i10N)) {
2483 throw new Exception('Found no L10n object');
2484 }
2485 $i10N->setAttributes(
2486 [
2487 'question' => $aI10NBlock['question'],
2488 'help' => $aI10NBlock['help'],
2489 'script' => $aI10NBlock['script'],
2490 ],
2491 false
2492 );
2493 if (!$i10N->save()) {
2494 throw new CHttpException(500, gT("Could not store translation"));
2495 }
2496 }
2497
2498 return true;
2499 }
2500
2501 /**
Stack Trace
#0
– /srv/www/htdocs/limesurvey4/application/controllers/QuestionAdministrationController.php(398): QuestionAdministrationController->applyL10n(Question, array("en" => array("question" => "", "help" => "")))
393 }
394
395 // Apply the changes to general settings, advanced settings and translations
396 $setApplied = [];
397
398 $setApplied['questionI10N'] = $this->applyL10n($question, $questionData['questionI10N']);
399
400 $setApplied['advancedSettings'] = $this->unparseAndSetAdvancedOptions(
401 $question,
402 $questionData['advancedSettings']
403 );
#1
- /srv/www/htdocs/limesurvey4/framework/web/actions/CInlineAction.php(49): QuestionAdministrationController->actionSaveQuestionData()
#2
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(308): CInlineAction->runWithParams(array())
#3
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(286): CController->runAction(CInlineAction)
#4
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#5
– /srv/www/htdocs/limesurvey4/application/controllers/LSBaseController.php(160): CController->run("saveQuestionData")
155 $this->redirect(array('/admin/authentication/sa/login'));
156 }
157 }
158 }
159
160 parent::run($action);
161 }
162
163 /*
164 Load and set session vars
165 *
#6
- /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(282): LSBaseController->run("saveQuestionData")
#7
- /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(141): CWebApplication->runController("questionAdministration/saveQuestionData")
#8
- /srv/www/htdocs/limesurvey4/framework/base/CApplication.php(185): CWebApplication->processRequest()
#9
– /srv/www/htdocs/limesurvey4/index.php(182): CApplication->run()
177 require_once APPPATH . 'core/LSYii_Application' . EXT;
178
179 $config = require_once(APPPATH . 'config/internal' . EXT);
180
181 Yii::$enableIncludePath = false;
182 Yii::createApplication('LSYii_Application', $config)->run();
183
184 / End of file index.php /
185 / Location: ./index.php /
I'm able to edit the saved question but when I try to save it again I have a time out (please see sceenshot below)
When I use 2) Click on group -> Add question (quick action button) i got this :
CHttpException
Invalid question id
/srv/www/htdocs/limesurvey4/application/controllers/QuestionAdministrationController.php(125)
113 @param int $questionId
114 @param string $tabOverviewEditor which tab should be used this can be 'overview' or 'editor'
115 @return void
116 @throws CHttpException
117 */
118 public function actionEdit($questionId, $tabOverviewEditor = 'overview')
119 {
120 $questionId = (int) $questionId;
121
122 /* @var Question|null /
123 $question = Question::model()->findByPk($questionId);
124 if (empty($question)) {
125 throw new CHttpException(404, gT("Invalid question id"));
126 }
127
128 if (!Permission::model()->hasSurveyPermission($question->sid, 'surveycontent', 'update')) {
129 Yii::app()->user->setFlash('error', gT("Access denied"));
130 $this->redirect(Yii::app()->request->urlReferrer);
131 }
132
133 // "Directly show edit mode" personal setting
134 $tabOverviewEditor = SettingsUser::getUserSettingValue('noViewMode', App()->user->id) ? 'editor' : $tabOverviewEditor;
135
136 $this->aData['closeUrl'] = Yii::app()->createUrl(
137 'questionAdministration/view/',
Stack Trace
#0
– /srv/www/htdocs/limesurvey4/application/controllers/QuestionAdministrationController.php(68): QuestionAdministrationController->actionEdit(0)
63
64 @throws CException
65 */
66 public function actionView($surveyid, $gid = null, $qid = null, $landOnSideMenuTab = 'structure')
67 {
68 $this->actionEdit($qid);
69 }
70
71 /*
72 Show form to create new question.
73 *
#1
unknown(0): QuestionAdministrationController->actionView("452199", "10", null, "structure")
#2
- /srv/www/htdocs/limesurvey4/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(QuestionAdministrationController, array("452199", "10", null, "structure"))
#3
- /srv/www/htdocs/limesurvey4/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(QuestionAdministrationController, ReflectionMethod, array("surveyid" => "452199", "gid" => "10"))
#4
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(308): CInlineAction->runWithParams(array("surveyid" => "452199", "gid" => "10"))
#5
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(286): CController->runAction(CInlineAction)
#6
- /srv/www/htdocs/limesurvey4/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#7
– /srv/www/htdocs/limesurvey4/application/controllers/LSBaseController.php(160): CController->run("view")
155 $this->redirect(array('/admin/authentication/sa/login'));
156 }
157 }
158 }
159
160 parent::run($action);
161 }
162
163 /*
164 Load and set session vars
165 *
#8
- /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(282): LSBaseController->run("view")
#9
- /srv/www/htdocs/limesurvey4/framework/web/CWebApplication.php(141): CWebApplication->runController("questionAdministration/view")
#10
- /srv/www/htdocs/limesurvey4/framework/base/CApplication.php(185): CWebApplication->processRequest()
#11
– /srv/www/htdocs/limesurvey4/index.php(182): CApplication->run()
177 require_once APPPATH . 'core/LSYii_Application' . EXT;
178
179 $config = require_once(APPPATH . 'config/internal' . EXT);
180
181 Yii::$enableIncludePath = false;
182 Yii::createApplication('LSYii_Application', $config)->run();
183
184 / End of file index.php /
185 / Location: ./index.php /
|
|
|
The PR solves my issue, @aschwey . Please wait for it to be merged in the next 1-2 days. Then, pull again, clear assets cache (global settings), delete browser cache, and try again. |
|
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30998 |
|
|
Fixed in Release 4.4.2+210208 |
|
|
Thank you very much to all for fixing that issue so quickly. Great job, excellent service ! |
|