View Issue Details

IDProjectCategoryView StatusLast Update
13738Bug reports[All Projects] RemoteControlpublic2018-06-14 20:33
Reporteraaskoura Assigned Toollehar  
PrioritynoneSeveritymajor 
Status feedbackResolutionreopened 
Product Version3.8.x 
Target VersionFixed in Version3.10.x 
Summary13738: RPC method upload_file is not working.
Description

RPC method upload_file is not working.

Steps To Reproduce

using postman

1- get_session_key
{"method": "get_session_key", "params": [ "var_user_name_string","var_password_string" ], "id": 1}
returns
{"id":1,"result":"var_session_key_string","error":null}

2- upload_file
{"method": "upload_file", "params": [ "var_session_key_string",var_sid_int, "var_fu_SGQA_string", "var_file_name_string", "var_file_content_base64_string" ], "id": 1}
returns
HTML, not even json (attached)

attached response

Additional Information

in latest version, an extra validation was created when adding a given response... This method - in case the survey has a file_upload question type, will check if the file exists in the temp directory before moving it.

A current call to add_response with the new extra validation results into error message: unable to move files {temp_directory}/{file_name}

OfflineSurveys, due to lack of an RPC upload_file (only introduced recently) used to upload files directly into the survey files directory. This extra validation is forcing us to use RPC method upload_file which is currently not working..

Otherwise, is it also possible to add a method to enable/disable this validation on adding a given response? It could make perfect sense to enable it by default on web responses, there is no backward compatibility issues here, but it completely breaks how OfflineSurveys submit responses to LimeSurvey server.
Is it possible can we add a new optional param to "add_response" method to skip file check in tmp folder if it is not necessary...

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.8.1+180524
I will donate to the project if issue is resolvedNo
BrowserN/A - REST Client
Database & DB-VersionMySQL 5
Server OS (if known)Ubuntu 14 TLS
Webserver software & version (if known)Apache 2
PHP VersionPHP Version 7.0.30

Activities

aaskoura

aaskoura

2018-06-03 15:25

reporter  

file_upload_response.html (32,200 bytes)
Mazi

Mazi

2018-06-03 15:43

partner   ~47953

Hej Olle, this is related to the remote control fix you already applied recently. There is still another issue, see details above.

aaskoura

aaskoura

2018-06-04 10:37

reporter   ~47954

Can we add (validateFiles = TRUE) to RPC method add_response that we can set to false to maintain backward compatibility

ollehar

ollehar

2018-06-04 10:46

administrator   ~47955

Who ever implemented this feature in the first place should be responsible in fixing it. Did you ask the person I linked on github?

ollehar

ollehar

2018-06-04 10:46

administrator   ~47956

@aaskoura Maybe you should open a separate ticket for that issue?

Mazi

Mazi

2018-06-04 10:55

partner   ~47957

@olle, which exact commit do you refer to? Who has adjusted that function recently without looking at backwards compatibility?
Maybe you can ping me on Skype since we need a fix urgently. Currently users can't submit responses.

ollehar

ollehar

2018-06-04 13:39

administrator   ~47961

@Mazi, I pinged you in this commit: https://github.com/LimeSurvey/LimeSurvey/commit/a6b9fe0542699faa29ca93bb4007e1db172cb6f2

You should get in touch with the implementor.

DenisChenu

DenisChenu

2018-06-05 08:00

developer   ~47980

The issue is here : https://github.com/LimeSurvey/LimeSurvey/commit/66c1871d981128178f8cebe9ff91ff7bfb77d024 :)

ollehar

ollehar

2018-06-05 12:20

administrator   ~47986

pardo-bsso seems to be not available. So who wants to repair his bugs...?

Mazi

Mazi

2018-06-07 23:30

partner   ~48023

@olle: You already fixed a related issue, can you give it a try?

ollehar

ollehar

2018-06-11 14:36

administrator   ~48044

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

ollehar

ollehar

2018-06-11 14:36

administrator   ~48045

@Mazi Pushed a fix. Feel free to test, but don't git pull into a production environment (some things are broken right now).

Mazi

Mazi

2018-06-11 16:11

partner   ~48048

Thanks, olle!

Does the fix only look that complex (many adjusted files)? Is it sufficient to only adjust the remotecontrol_handle.php and export_helper.php files for testing?

ollehar

ollehar

2018-06-11 16:23

administrator   ~48049

Whoops, the fix included some composer files. I did not expect them to be included, that was a mistake by me. Only the two first files are the actual fix.

Mazi

Mazi

2018-06-14 20:33

partner   ~48116

It looks like after the recent fix the API returns invalid or unexpected token. We'll analyse the issue and post comments here.

Related Changesets

LimeSurvey: master 8dd05df8

2018-06-11 14:35:32

ollehar

Details Diff
Fixed issue 13738: RPC method is not working. Affected Issues
13738
mod - application/helpers/export_helper.php Diff File
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File
mod - third_party/composer/autoload_classmap.php Diff File
mod - third_party/composer/autoload_namespaces.php Diff File
mod - third_party/composer/autoload_psr4.php Diff File
mod - third_party/composer/autoload_static.php Diff File

Issue History

Date Modified Username Field Change
2018-06-03 15:25 aaskoura New Issue
2018-06-03 15:25 aaskoura File Added: file_upload_response.html
2018-06-03 15:42 Mazi Assigned To => ollehar
2018-06-03 15:42 Mazi Status new => assigned
2018-06-03 15:43 Mazi Note Added: 47953
2018-06-04 10:37 aaskoura Note Added: 47954
2018-06-04 10:46 ollehar Note Added: 47955
2018-06-04 10:46 ollehar Note Added: 47956
2018-06-04 10:55 Mazi Note Added: 47957
2018-06-04 13:39 ollehar Note Added: 47961
2018-06-05 08:00 DenisChenu Note Added: 47980
2018-06-05 12:20 ollehar Note Added: 47986
2018-06-07 23:30 Mazi Note Added: 48023
2018-06-11 14:36 ollehar Changeset attached => LimeSurvey master 8dd05df8
2018-06-11 14:36 ollehar Note Added: 48044
2018-06-11 14:36 ollehar Resolution open => fixed
2018-06-11 14:36 ollehar Note Added: 48045
2018-06-11 14:36 ollehar Status assigned => feedback
2018-06-11 16:11 Mazi Note Added: 48048
2018-06-11 16:23 ollehar Note Added: 48049
2018-06-11 16:25 ollehar Status feedback => resolved
2018-06-11 16:32 markusfluer Status resolved => closed
2018-06-11 16:32 markusfluer Fixed in Version => 3.10.x
2018-06-14 20:33 Mazi Status closed => feedback
2018-06-14 20:33 Mazi Resolution fixed => reopened
2018-06-14 20:33 Mazi Note Added: 48116