View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
16474Bug reportsRemoteControlpublic2021-02-24 10:36
Reporterliantis_pieterjan Assigned Togabrieljenik  
PrioritynoneSeverityblock 
Status closedResolutionfixed 
Product Version4.3.1 
Summary16474: Remote control import_group broken
Description

cross posting from the forum:
https://forums.limesurvey.org/forum/development/121762-bug-in-remote-control-api-import_group#202489

Hi I'm using LimeSurvey Version 4.3.1+200623

When trying to import an .lsg file I get the following response:

500: Internal Server Error
Too few arguments to function XMLImportGroup(), 2 passed in /var/www/html/application/helpers/remotecontrol/remotecontrol_handle.php on line 1123 and exactly 3 expected

I checked the code in github and it seems that back in April the XMLImportGroup in application/helpers/admin/import_helper.php was modified. Instead of 2 parameters it now has 3.

And questiongroups.php was modified to allow import via the website, but the remotecontrol_handle.php is still using only two parameters. Thus the import_group is broken.

Could someone verify these findings. And if correct, report this as an issue?

Best regards

Steps To Reproduce

call import_group on the remote control API

Tagsremote control
Bug heat8
Complete LimeSurvey version number (& build)4.3.1+200623
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMariaDB 10.5.4
Server OS (if known)
Webserver software & version (if known)
PHP Version7.3.19

Users monitoring this issue

There are no users monitoring this issue.

Activities

liantis_pieterjan

liantis_pieterjan

2020-07-09 13:43

reporter   ~58838

I fixed the issue in the latest version (Version 4.3.3+200707) locally.

I patched remotecontrol_handle.php at line 1123
Changing:
$aImportResults = XMLImportGroup($sFullFilePath, $iSurveyID);

into:
$aImportResults = XMLImportGroup($sFullFilePath, $iSurveyID, (App()->request->getPost('translinksfields') == '1'));

and afterwards the import_group remote control is functioning again.
Could someone integrate this fix? Not sure whether you guys could write a test on this. I don't have experience creating unit tests in PHP otherwise I'd do it.

cdorin

cdorin

2020-07-09 15:07

reporter   ~58856

@ollehar? have time to take a look at the issue?

Thanks for report!

cdorin

cdorin

2020-12-23 17:41

reporter   ~61119

@gabrieljenik , have time to take a look at this one ?

gabrieljenik

gabrieljenik

2020-12-29 16:32

manager   ~61275

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1698

Fixed and added a test

gabrieljenik

gabrieljenik

2021-02-19 15:37

manager   ~62405

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

lime_release_bot

lime_release_bot

2021-02-24 10:36

administrator   ~62479

Fixed in Release 4.4.10+210222

Related Changesets

LimeSurvey: master db693f74

2020-12-29 16:21:11

gabrieljenik

Details Diff
Fixed issue 16474: Remote control import_group broken

Fixed and Added test case
Affected Issues
16474
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File
mod - tests/TestHelper.php Diff File
add - tests/data/file_upload/limesurvey_group_472.lsg Diff File
add - tests/data/surveys/limesurvey_survey_251297_import_group.lss Diff File
mod - tests/unit/helpers/RemoteControlTest.php Diff File

LimeSurvey: master 775a27bc

2020-12-29 19:54:53

gabrieljenik

Details Diff
Fixed issue 16474: Remote control import_group broken

Changed how to load library to avoid duplicated: Rollback on TestHelper and Updated on RemoteControl Handle.
Affected Issues
16474
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File
mod - tests/TestHelper.php Diff File

LimeSurvey: master 05c55454

2021-02-19 15:37:36

ollehar


Committer: GitHub Details Diff
Fixed issue 16474: Remote control import_group broken

Merge pull request #1698 from gabrieljenik/bug/16474--Remote-control-import_group-broken
Affected Issues
16474
mod - application/helpers/remotecontrol/remotecontrol_handle.php Diff File
add - tests/data/file_upload/limesurvey_group_472.lsg Diff File
add - tests/data/surveys/limesurvey_survey_251297_import_group.lss Diff File
mod - tests/unit/helpers/RemoteControlTest.php Diff File

Issue History

Date Modified Username Field Change
2020-07-08 19:59 liantis_pieterjan New Issue
2020-07-09 13:43 liantis_pieterjan Note Added: 58838
2020-07-09 14:04 liantis_pieterjan Tag Attached: remote control
2020-07-09 15:07 cdorin Note Added: 58856
2020-12-23 17:41 cdorin Note Added: 61119
2020-12-29 16:32 gabrieljenik Note Added: 61275
2021-02-19 15:37 ollehar Changeset attached => LimeSurvey master 05c55454
2021-02-19 15:37 gabrieljenik Changeset attached => LimeSurvey master 775a27bc
2021-02-19 15:37 gabrieljenik Changeset attached => LimeSurvey master db693f74
2021-02-19 15:37 gabrieljenik Note Added: 62405
2021-02-19 15:37 gabrieljenik Assigned To => gabrieljenik
2021-02-19 15:37 gabrieljenik Resolution open => fixed
2021-02-19 15:39 ollehar Status new => resolved
2021-02-24 10:36 lime_release_bot Note Added: 62479
2021-02-24 10:36 lime_release_bot Status resolved => closed