View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18350 | Bug reports | RemoteControl | public | 2022-09-14 14:52 | 2023-11-13 15:43 |
Reporter | Selcal | Assigned To | mfavetti | ||
Priority | none | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 5.3.x | ||||
Summary | 18350: activate_survey does not correctly set inherited properties for Notification and data management | ||||
Description | When using the call activate_survey (which does not accept any options according to the docs), the activated survey does not carry the inherited settings for Notification and Data management. They are all set to NO. Activating using the webinterface, these questions are asked in separate dropdowns, presumably setting the options prior to activation. However, I would expect activating a survey would use inherited values without manually having to loop through them to set them manually first? | ||||
Steps To Reproduce | Create non activated survey with notification and data management set to Inherit | ||||
Tags | No tags attached. | ||||
Bug heat | 24 | ||||
Complete LimeSurvey version number (& build) | Version 5.3.32+220817 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | 10.3.34-MariaDB-cll-lve - MariaDB Server | ||||
Server OS (if known) | UNIX | ||||
Webserver software & version (if known) | Apache | ||||
PHP Version | 7.3 | ||||
In fact, manually looking at the settings, they are all copied as value 'I', which is indeed a simple copy. |
|
Feel free to do a pull request. |
|
I would, if I felt anywhere near comfortable to safely make this adjustment in the LS code. I do not. As it stands, AFAIK, using Remove control, I cannot use a get call to see what the inheritable settings are (doing get_survey_properties on the survey returns 'inherit', and the settings are not in the get_global settings). Without that workaround, activating a survey using Remote Control breaks the activated survey and my intend was to inform you of this. It is not intended to suggest anyone is obliged to fix this, and if I could do it myself (without surely breaking functionality or stability of the code), I would. Sorry about that. |
|
This is there even in LS 2.05+.
in the file application/models/SurveyDynamic.php |
|
@Selcal This is a problem on
Does this happen as well when activating through regular UI? |
|
@gabrieljenik Doing the same through the UI, the UI asks specifically for these settings during the activation steps. However, the API call does not take any arguments, so these are not quite equal behaviour. Either way, setting the database on activated survey to (I)nherit is not correct behaviour as this setting is not valid for an activated survey. |
|
Thanks. Thngs are a bit clearer now. When you say...
What do you mean they Thanks |
|
Sorry, I meant get_global_settings. In other words, it's not possible for me to find out dynamically what the properties that are set to Inherit are supposed to be. For these settings, the set_survey_properties can only be called prior to activation. After, the settings are restricted (which is what permanently breaks the activated survey). So at the moment, the settings have to be set before activation, using predetermined values set by the function call. Whereas values set to Inherit would normally... well inherit the settings from the parent :). |
|
So, basically it works on RemoteControl the same way it works as with the manual GUI. |
|
Yes and no. The GUI will ask to confirm the settings, which is an extra step. However, it auto-fills the settings dialog with those inherited from the global settings (ie, it automatically takes inherited settings). -Activating with the GUI will, if leaving everything as-is, create a working survey with the values inherited. |
|
Maybe the RPC needs to use the activate survey class? |
|
The SurveyActivator? Already is |
|
OK, so there's more logic in the controller class then that's not replicated in the RPC class? |
|
I thought so at the very begining, but not exactly.
|
|
OK, so just add more arguments to the RPC call? Not possible? |
|
That
|
|
@Selcal are you up for making a PR with the needed change? |
|
[quote]or/and make a new method for getting the global_settings when they are I on the suvey[/quote] I think that'd be the way to go since going the arguments route, the RC caller still needs to know the to-be-inherited values for the fields set to I. And right now this isn't possible it seems. @gabrieljenik, I can try, but it's going take a long time for me. So far I have some feel with Limesurvey as a user, but haven't gone into the code. It'll take me awhile to figure out what is where and what is safe to change. |
|
@tibor.pacalat Let you review if this is something I should tackle or not. Thanks |
|
@gabrieljenik Sure, but only if there are no more pressing critical/blocker issues that are still untouched. |
|
OK. Just assign it when you feel it is the right time. Thanks |
|
I'm picking this up |
|
been doing some testing with this. I would suggest not to use the activate_survey RPC call at all until a fix is in place. if any of the activation opts are set on the global survey/survey group, and you activate via RPC call, limesurvey does not actually record any survey responses, although you can take the survey just fine. (so there would be data loss.) so beyond the issue of not being able to set the activation options in the activate_survey call, limesurvey expects these values to already be set to the inherited value from the global survey/survey group upon activation and does not handle the case where they are still set to "I" a workaround for now would be to set the survey properties manually before activation (there is no way I can see to get the value you would inherit from the survey group/global survey group, so you would need to decide on the value,) we should also consider adding the ability to get/set the global survey/survey group settings |
|
master pr: https://github.com/LimeSurvey/LimeSurvey/pull/3595 after review, I can backport to 5.x basically, the approach is to first use the survey settings that result from merging the survey settings, survey group settings, and global survey settings. then I also allow for user to pass in activation settings values to override the merged settings (analogous to the settings in the activation dialog) |
|
Why not use directly https://github.com/LimeSurvey/LimeSurvey/blob/ea1c4ba3b12dd817bc820c6239b72e4d476ccd7d/application/models/Survey.php#L163 Survey->oOtions->anonymized I think it's the way to do. See for example https://github.com/LimeSurvey/LimeSurvey/blob/ea1c4ba3b12dd817bc820c6239b72e4d476ccd7d/application/core/LimeMailer.php#L284 |
|
I don't see usage of datestamp in activator We have only issue with datestamp ? I check for
Here the result is already in oOptions, and the usage MUST be the dedicated option : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Survey.php#L114 |
|
I will update the pr to use the oOptions property rather than using the getSurveyInfo from common helper to access the merged settings. I reiterate here that the survey taking part of limesurvey does not handle a value of "I" for the survey activation related settings properly. This results in data loss. I think this problem should also be fixed. But the problem in this particular issue is that the rpc function to activate a survey does not provide equivalent functionality to the admin activate button/dialog (using merged settings, with the option for the user to override), and thus cannot be used to properly activate a survey. my pr addresses this. we could open a separate issue for the handling of survey related activation settings being set to "I" (inherit) by the survey taking portion of the software. |
|
Some comments, the current PR fix the issue. |
|
From my more user/reporter perspective; it seems that any active survey should not be able to have "I" for survey settings, which is why the survey taking does not handle it properly. At this moment the "I" setting could only exist through the RPC call which this report focusses on. As the admin interface otherwise handles this and sets the value, and no other way of having "I" setting left exists. If I'm correct, then the survey taking does not need to handle "I", as this is 'simply' an invalid setting. The PR would fix this; "I" would no longer be possible. |
|
@DenisChenu updated pr in response to your feedback, thank you |
|
@Selcal correct, this pr would allow the rpc activate_survey call to replace "I" values with "Y" or "N" based on inheritance from the survey settings, survey group settings, and global survey settings. It also adds the ability for the user to override the inherited value if desired. This results in no "I" values on the activated survey and creates parity between the rpc function and the activation button/dialog in the admin interface. I also agree that the software should properly handle an "I" or invalid setting in an activated survey. Maybe default to inherited value? Because at present this case causes data loss. |
|
Also agree (and i start a comment about this on PR) BUT |
|
not related at all to LSA import |
|
If you leave I in survey, when export it set to I It's totally related to LSA here. |
|
Patch is OK for the purpose (same than GUI) PHP7 speed difference between isset and array_key_exist is low. Ready for testing |
|
this issue relates to survey activation using RPC function activate_survey only why related to LSA import??? I'm confused what you mean |
|
the settings are only changed when activating the survey export with "I" -> import with "I" after activating, they can be only "Y" or "N". "I" is not possible. so then think its okay |
|
Yes,
Then: it's OK :) |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35722 |
|
here's the pr for 5.x: https://github.com/LimeSurvey/LimeSurvey/pull/3609 |
|
I tested the fix for 5.x, works! @DenisChenu can you please do the core review? |
|
@tibor.pacalat its the same commit from master cherry picked to 5.x so exact same code |
|
I just check SonarCloud to be green and merge it. |
|
Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35744 |
|
Fixed in Release 6.3.5+231113 |
|
LimeSurvey: master 51705eb6 2023-11-07 10:45 Committer: GitHub Details Diff |
Fixed issue 18350: activate_survey does not correctly set inherited properties for Notification and data management (#3595) |
Affected Issues 18350 |
|
mod - application/helpers/remotecontrol/remotecontrol_handle.php | Diff File | ||
LimeSurvey: 5.x 89712baf 2023-11-10 15:18 Committer: GitHub Details Diff |
Fixed issue 18350: activate_survey does not correctly set inherited properties for Notification and data management (#3595) (03609) |
Affected Issues 18350 |
|
mod - application/helpers/remotecontrol/remotecontrol_handle.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-09-14 14:52 | Selcal | New Issue | |
2022-09-14 14:58 | Selcal | Note Added: 71742 | |
2022-09-14 14:58 | Selcal | Bug heat | 0 => 2 |
2022-09-15 11:15 | ollehar | Note Added: 71757 | |
2022-09-15 11:15 | ollehar | Bug heat | 2 => 4 |
2022-09-15 19:38 | Selcal | Note Added: 71777 | |
2022-09-24 00:00 | gabrieljenik | Status | new => acknowledged |
2023-07-22 20:52 | apmuthu | Bug heat | 4 => 10 |
2023-07-22 20:59 | apmuthu | Note Added: 76236 | |
2023-07-22 20:59 | apmuthu | Bug heat | 10 => 12 |
2023-08-07 23:38 | gabrieljenik | Assigned To | => gabrieljenik |
2023-08-07 23:38 | gabrieljenik | Status | acknowledged => assigned |
2023-08-11 22:32 | gabrieljenik | Note Added: 76546 | |
2023-08-11 22:32 | gabrieljenik | Bug heat | 12 => 14 |
2023-08-14 15:42 | Selcal | Note Added: 76576 | |
2023-08-14 16:54 | gabrieljenik | Note Added: 76578 | |
2023-08-14 17:43 | gabrieljenik | Note Edited: 76578 | |
2023-08-15 12:44 | Selcal | Note Added: 76590 | |
2023-08-15 13:40 | gabrieljenik | Note Added: 76598 | |
2023-08-15 19:44 | Selcal | Note Added: 76607 | |
2023-08-16 14:55 | ollehar | Note Added: 76616 | |
2023-08-16 14:58 | gabrieljenik | Note Added: 76617 | |
2023-08-16 15:00 | ollehar | Note Added: 76618 | |
2023-08-16 15:06 | gabrieljenik | Note Added: 76619 | |
2023-08-16 15:10 | ollehar | Note Added: 76620 | |
2023-08-16 15:16 | gabrieljenik | Note Added: 76621 | |
2023-08-16 15:19 | gabrieljenik | Note Added: 76622 | |
2023-08-16 16:32 | Selcal | Note Added: 76626 | |
2023-10-05 00:06 | gabrieljenik | Assigned To | gabrieljenik => tibor.pacalat |
2023-10-05 00:06 | gabrieljenik | Status | assigned => feedback |
2023-10-05 00:06 | gabrieljenik | Note Added: 77514 | |
2023-10-05 16:57 | tibor.pacalat | Note Added: 77527 | |
2023-10-05 16:57 | tibor.pacalat | Bug heat | 14 => 16 |
2023-10-05 17:11 | gabrieljenik | Note Added: 77530 | |
2023-10-27 12:34 | tibor.pacalat | Assigned To | tibor.pacalat => mfavetti |
2023-10-27 12:34 | tibor.pacalat | Status | feedback => assigned |
2023-10-27 22:55 | mfavetti | Note Added: 78109 | |
2023-10-27 22:55 | mfavetti | Bug heat | 16 => 18 |
2023-10-30 19:09 | mfavetti | Issue Monitored: mfavetti | |
2023-10-30 19:09 | mfavetti | Bug heat | 18 => 20 |
2023-11-03 01:35 | mfavetti | Note Added: 78219 | |
2023-11-03 06:45 | mfavetti | Note Added: 78220 | |
2023-11-03 06:45 | mfavetti | Assigned To | mfavetti => DenisChenu |
2023-11-03 06:45 | mfavetti | Status | assigned => ready for code review |
2023-11-03 08:05 | DenisChenu | Note Added: 78222 | |
2023-11-03 08:05 | DenisChenu | Bug heat | 20 => 22 |
2023-11-03 08:16 | DenisChenu | Note Added: 78223 | |
2023-11-03 09:04 | mfavetti | Note Added: 78227 | |
2023-11-03 09:06 | DenisChenu | Assigned To | DenisChenu => mfavetti |
2023-11-03 09:06 | DenisChenu | Status | ready for code review => in code review |
2023-11-03 09:06 | DenisChenu | Note Added: 78228 | |
2023-11-03 09:15 | Selcal | Note Added: 78229 | |
2023-11-03 09:18 | mfavetti | Note Added: 78230 | |
2023-11-03 09:22 | mfavetti | Note Added: 78231 | |
2023-11-03 09:22 | mfavetti | Note Edited: 78231 | |
2023-11-03 09:59 | DenisChenu | Note Added: 78234 | |
2023-11-03 10:00 | mfavetti | Note Added: 78235 | |
2023-11-03 10:08 | DenisChenu | Note Added: 78236 | |
2023-11-03 10:10 | DenisChenu | Status | in code review => ready for testing |
2023-11-03 10:10 | DenisChenu | Note Added: 78237 | |
2023-11-03 10:25 | mfavetti | Note Added: 78238 | |
2023-11-04 04:55 | mfavetti | Note Added: 78266 | |
2023-11-04 04:55 | mfavetti | Note Edited: 78266 | |
2023-11-06 08:49 | DenisChenu | Note Added: 78272 | |
2023-11-06 08:49 | DenisChenu | Assigned To | mfavetti => tibor.pacalat |
2023-11-07 09:45 | mfavetti | Changeset attached | => LimeSurvey master 51705eb6 |
2023-11-07 09:45 | mfavetti | Note Added: 78309 | |
2023-11-07 09:45 | mfavetti | Assigned To | tibor.pacalat => mfavetti |
2023-11-07 09:45 | mfavetti | Resolution | open => fixed |
2023-11-09 08:16 | mfavetti | Note Added: 78345 | |
2023-11-09 20:20 | tibor.pacalat | Note Added: 78368 | |
2023-11-09 20:45 | mfavetti | Note Added: 78373 | |
2023-11-10 08:10 | DenisChenu | Note Added: 78381 | |
2023-11-10 14:18 | mfavetti | Changeset attached | => LimeSurvey 5.x 89712baf |
2023-11-10 14:18 | mfavetti | Note Added: 78390 | |
2023-11-10 14:19 | tibor.pacalat | Status | ready for testing => resolved |
2023-11-13 15:43 | LimeBot | Note Added: 78433 | |
2023-11-13 15:43 | LimeBot | Status | resolved => closed |
2023-11-13 15:43 | LimeBot | Bug heat | 22 => 24 |