View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
15632Bug reportsRemoteControlpublic2020-03-09 15:36
Reporterbismark Assigned Toollehar  
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Product Version3.20.x 
Summary15632: RemoteControl cpd_importParticipants insert and/or update
Description

need to discuss the update of a cpdb participant record via remote control

there is a method cpd_importParticipants which inserts a participant.
if the record already exists, I also want to update some fields. but there is no such method in remote control.

whats the better way?

  1. extend cpd_importParticipant to update existing record?
  2. create new method cpd_updateParticipants($sSessionKey, $aParticipants)
TagsNo tags attached.
Attached Files
Bug heat10
Complete LimeSurvey version number (& build)master
I will donate to the project if issue is resolvedNo
Browser
Database type & version10.1.26-MariaDB
Server OS (if known)
Webserver software & version (if known)
PHP Version7.1.8

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2019-11-28 13:28

manager   ~54859

I believe that extending cpd_importParticipant to update existing record is a better option.
Still, that feature could share some code with cpd_updateParticipants, which indeed, seems important.

If have to choose only one, then, theorically, cpd_updateParticipants seems more important as it is a more basic component.
Then that function could be reused by a script to do an import/update.
But still, both seems good additions to the API

bismark

bismark

2019-11-29 10:12

reporter   ~54887

public function cpd_importParticipants($sSessionKey, $aParticipants, $update = false) {...}

PR coming soon

Mazi

Mazi

2019-11-29 10:14

updater   ~54888

I also vote to extend the existing function by using a new parameter with default $update = false. If set to true, we can easily extend the function to update existing data sets. That will make it easy for the common user already using the same function to update data sets if needed by just changing the new parameter value.

Mazi

Mazi

2019-12-02 09:22

updater   ~54894

@c_schmitz, can you please let us know if the suggested approach ("extend the existing function by using a new parameter with default $update = false") is fine with you?

DenisChenu

DenisChenu

2019-12-02 09:28

developer   ~54895

I already think we need a 'Update participant' (for token, no CPDB, but CPDB can need same) in GUI too ....

But we need a way to know how the update must be found (same with RC and CPDB):

  1. default by token (if not empty), participant_id for CPDB
  2. Can be a single column : (email or an attribute)
  3. Can be a multiple column (firstname + lastname)
  4. Did we allow to update ALL participant with same data : Example Attribute_1 is "Company" and the company update Name : you need to put the new Company name in all token with the prevous company name.

Updating cpd_importParticipants with update = true : What is the participant to update (how you finds already exists record ?) : only if participant_id is set.

bismark

bismark

2019-12-03 14:35

reporter   ~54915

actually I only need to update the status blacklisted yes or no.

DenisChenu

DenisChenu

2019-12-03 14:38

developer   ~54916

Then by userid or email ?

ollehar

ollehar

2019-12-03 15:08

administrator   ~54917

To add this in LS3, there needs to be acceptance tests and some kind of specification, preferably in scenario form. I will give more details later (also per email with bismark).

ollehar

ollehar

2019-12-03 15:10

administrator   ~54918

Some manual links:

https://manual.limesurvey.org/Regression_and_unit_tests

https://manual.limesurvey.org/How_to_contribute_new_features

feature_workflow.png (40,374 bytes)   
feature_workflow.png (40,374 bytes)   
ollehar

ollehar

2019-12-03 15:11

administrator   ~54919

The new acceptance test should be in a folder containing the Mantis ticket number and a short description, as in this case: https://github.com/LimeSurvey/LimeSurvey/tree/master/tests/functional/acceptance/15532-em-warnings

ollehar

ollehar

2019-12-03 15:12

administrator   ~54920

Here's an example on how to test the remote API: https://github.com/LimeSurvey/LimeSurvey/blob/master/tests/helpers/RemoteControlTest.php

DenisChenu

DenisChenu

2019-12-03 16:07

developer   ~54929

To add this in LS3, there needs to be acceptance tests and some kind of specification, preferably in scenario form. I will give more details later (also per email with bismark).

Then we can add new feature in 3.X if there are

  1. Manual acceptance test
  2. Specifications and usage scenario
  3. Unit tests

I think new feature is only for 4.X

ollehar

ollehar

2019-12-03 16:20

administrator   ~54930

Last edited: 2019-12-03 16:21

@DenisChenu I'm trying to reach a compromise that works for everybody. Yes, new features only in dev branch would be best, but now so many half-finished things are merged into dev that it's impossible to release a stable version (yet). We choose to accept this new feature in LS3, since it is small and assuming it complies to a more strict workflow than before to reduce the risk of instability. If it still leads to instability, then yes, we have to rethink our position.

The acceptance tests should be automatic when possible, but manual QA and code-review is also a requirement before merging.

DenisChenu

DenisChenu

2019-12-03 16:22

developer   ~54931

Ok , it's an information ;)

Client NEED a new feature in less than one month : 1 hour for new feature + 1 day for acceptance test ;)

ollehar

ollehar

2019-12-03 16:25

administrator   ~54932

Yes, writing tests is costly, but not writing tests is even more costly (long term). ;)

DenisChenu

DenisChenu

2019-12-03 16:27

developer   ~54933

:) :+1:

bismark

bismark

2020-01-09 11:54

reporter   ~55170

https://github.com/LimeSurvey/LimeSurvey/pull/1361

Issue History

Date Modified Username Field Change
2019-11-28 10:25 bismark New Issue
2019-11-28 13:28 gabrieljenik Note Added: 54859
2019-11-29 10:12 bismark Note Added: 54887
2019-11-29 10:14 Mazi Note Added: 54888
2019-12-02 09:22 Mazi Note Added: 54894
2019-12-02 09:28 DenisChenu Note Added: 54895
2019-12-03 14:35 bismark Note Added: 54915
2019-12-03 14:38 DenisChenu Note Added: 54916
2019-12-03 15:08 ollehar Note Added: 54917
2019-12-03 15:10 ollehar File Added: feature_workflow.png
2019-12-03 15:10 ollehar Note Added: 54918
2019-12-03 15:11 ollehar Note Added: 54919
2019-12-03 15:12 ollehar Note Added: 54920
2019-12-03 16:07 DenisChenu Note Added: 54929
2019-12-03 16:20 ollehar Note Added: 54930
2019-12-03 16:21 ollehar Note Edited: 54930
2019-12-03 16:22 DenisChenu Note Added: 54931
2019-12-03 16:25 ollehar Note Added: 54932
2019-12-03 16:27 DenisChenu Note Added: 54933
2020-01-09 11:54 bismark Note Added: 55170
2020-01-22 13:31 ollehar Assigned To => ollehar
2020-01-22 13:31 ollehar Status new => resolved
2020-01-22 13:31 ollehar Resolution open => fixed
2020-03-09 15:36 c_schmitz Status resolved => closed