-
Notifications
You must be signed in to change notification settings - Fork 993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
15632 remotecontrol cpd import participants update #1361
15632 remotecontrol cpd import participants update #1361
Conversation
…15632-remotecontrol-cpd_importParticipants-update
// save participant to database | ||
Participant::model()->insertParticipantCSV($aData); | ||
$scenario = $model->getScenario(); // insert or update | ||
if ($scenario == 'update' && $update === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange to use getScenario :)
Why not , maybe more simple to understand
if (!$model) {
// Create
} elseif (!$update) {
continue;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still think i prefer the elseif method. What it's your opinion @olleharstedt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion. So will merge.
Looks like lots of tests fail for some reason. I will run them locally and check. |
The test fails because there are too many failed login attempts. |
Nope, wrong. The test fails because the default user is overwritten from "admin" to "remotecontroladmin". |
Scrutinizer is more happy now :). Else : can you review the website and the email ? |
|
||
public static function setUpBeforeClass() | ||
{ | ||
Yii::import('application.helpers.common_helper', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are duplicated - they are already here: https://github.com/LimeSurvey/LimeSurvey/blob/master/tests/TestHelper.php#L23
I'm guessing you want this merged into new branch 3.x-LTS, not master (which is now LS4)? |
thats correct |
We also need this fix to be available at Limesurvey 4 later. |
No problem. |
👍 Please note that I won't merge until the issues are resolved (code duplication, in this case). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No external unknow website please
https://tools.ietf.org/html/rfc2606 or limesurvey.org for example . limesurvey.example can be good too :) |
Can you fix the things commented by Denis, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, just the elseif part. Buit more an opinion ;)
// save participant to database | ||
Participant::model()->insertParticipantCSV($aData); | ||
$scenario = $model->getScenario(); // insert or update | ||
if ($scenario == 'update' && $update === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still think i prefer the elseif method. What it's your opinion @olleharstedt ?
FYI, this PR has been cherry-picked into the master branch. |
Dev: fixed return array on checkSessionKey Dev: tests now use admin user with uid = 1 Dev: Remotecontrol BaseTest extends TestHelper
Fixed issue # : https://bugs.limesurvey.org/view.php?id=15632
New feature # :
Changed feature # : cpd_importParticipants allows updating records
Dev:
Dev: