View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10244Bug reportsRemoteControlpublic2016-02-06 00:36
Reporterstefanverweij Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.06+ 
Fixed in Version2.50.x 
Summary10244: 500 Internal Server Error on remote control ->add_survey call
Description

When the json-RPC remote control is use with the 'add_survey' command is send with (what i believe are) valid parameters, a 500 internal Server Error is returned.

When I add a 'wrong' parameter it does work, as in it returns a 'faulty parameter' message.

It does create a survey in the surveys table in mysql, but it does not create a new surveytable, etcetera.

When discussing with Ole on irc, currently setting the debug value to 2 and reloading the limesurvey site returns a php notice:

Trying to get property of non-object, in common_helper, line 203, ( $surveynames[] = array_merge($result->attributes, $result->defaultlanguage->attributes); ) and the stacktrace..

Steps To Reproduce

1) setup remote control, get a valid session token

2) send $myJSONRPCClient->add_survey($sessionKey,123456,"Survey","en","G");

3) get error: Warning: fopen(https://sitel/index.php/admin/remotecontrol): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)2.06+ Build 160123
I will donate to the project if issue is resolvedNo
Browserchrome/safari
Database type & versionmysql v184
Server OS (if known)ubuntu 4.14
Webserver software & version (if known)Apache/2.4.7,
PHP VersionPHP Version 5.5.9

Users monitoring this issue

There are no users monitoring this issue.

Activities

user47993

2016-02-03 10:36

  ~34504

Hi Stefan
There is the following code in application/helpers/remotecontrol/remotecontrol_handle.php in line 140:

// Load default email templates for the chosen language
$oLanguage = new Limesurvey_lang($sSurveyLanguage);
$aDefaultTexts = templateDefaultTexts($oLanguage, 'unescaped');
unset($oLanguage);

The class "Limesurvey_lang" can not be found and variable "$aDefaultTexts" is not used anywhere in the code. So it looks like this part of code is not necessary and it broke "remote control" functionality at the same time.

The functionality works fine if this part of code is removed

DenisChenu

DenisChenu

2016-02-03 10:53

developer   ~34513

@badaboom : yes but survey NEED survey_language_seetings ... else broken survey

user47993

2016-02-03 11:05

  ~34517

You have to pass language. In other case you will get exception
if( $sSurveyTitle=='' || $sSurveyLanguage=='' || !array_key_exists($sSurveyLanguage,getLanguageDataRestricted()) || !in_array($sformat, array('A','G','S')))
return array('status' => 'Faulty parameters');

line 119

So you have to pass language in any way and in this case we don't need default language.
And more: variable "$aDefaultTexts" is not used, so default language is not initialized.

Look at the file application/helpers/remotecontrol/remotecontrol_handle.php :: add_survey function.

I am not a developer of a survey. I had the same problem. I have disabled part of code described in my first comment and it works

c_schmitz

c_schmitz

2016-02-03 12:40

administrator   ~34527

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=17116

c_schmitz

c_schmitz

2016-02-06 00:36

administrator   ~34667

2.50+ Build 160206 released

Related Changesets

LimeSurvey: master 9b6e00bb

2016-02-03 11:40:20

c_schmitz

Details Diff
Fixed issue 10244: Internal Server Error on RemoteControl add_survey call Affected Issues
10244
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File

Issue History

Date Modified Username Field Change
2016-01-23 00:12 stefanverweij New Issue
2016-02-03 10:36 user47993 Note Added: 34504
2016-02-03 10:53 DenisChenu Note Added: 34513
2016-02-03 11:05 user47993 Note Added: 34517
2016-02-03 12:39 c_schmitz Assigned To => c_schmitz
2016-02-03 12:39 c_schmitz Status new => assigned
2016-02-03 12:40 c_schmitz Status assigned => resolved
2016-02-03 12:40 c_schmitz Fixed in Version => 2.5
2016-02-03 12:40 c_schmitz Resolution open => fixed
2016-02-03 12:40 c_schmitz Changeset attached => LimeSurvey master 9b6e00bb
2016-02-03 12:40 c_schmitz Note Added: 34527
2016-02-06 00:36 c_schmitz Note Added: 34667
2016-02-06 00:36 c_schmitz Status resolved => closed