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
New feature: add Plugin event afterFindSurvey #634
Conversation
Just a question : maybe add some ->set ? Minimal : |
Oh, and move Because : it's here to FIX : if template didn't exist anymore : set it to default. Then seems it's needed. |
@Shnoulle added, thanks! |
OK, we have dev meeting this afternoon :) i put this in topics of dev meeting :) Thanks a lot, a great pull request (IMO) |
application/models/Survey.php
Outdated
'showxquestions', 'shownoanswer', 'showprogress', 'questionindex', | ||
'usecaptcha', 'showgroupinfo', 'showqnumcode', 'navigationdelay'); | ||
foreach ($allowedAttributes as $attribute){ | ||
if (!is_null($event->get($attribute))) |
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.
Nit picky, but {
should be on same line as if
. Also, space between )
and {
above.
application/models/Survey.php
Outdated
@@ -247,6 +247,19 @@ public function rules() | |||
*/ | |||
public function fixSurveyAttribute($event) | |||
{ | |||
$event = new PluginEvent('afterFindSurvey'); | |||
$event->set('surveyid',$this->sid) ; |
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 space between )
and ;
.
👍 |
Thanks to all! |
@TonisOrmisson Please also add a manual page for this event. |
@olleharstedt Yes, was already looking into it, but have no build number yet. Anyway, will do that. |
I guess it will be next minor version: 2.63.0. |
does this seem ok: |
Version is OK now, not need buildnumber ? Right ? |
Yes, version is enough. |
@TonisOrmisson Great! |
and an initial version of a plugin that enables to set configured templates over url parameter https://github.com/TonisOrmisson/limesurvey-url-templates just needs a small additional LS change access Template list via api instead of referring directly to Template: |
@TonisOrmisson Did you test the plugin with the latest Limesurvey 3.1x version? |
@maziminke Im not sure. I am not actively using this plugin at this point so I can not comment on the latest releases (I have a plan for it for the future). But I can check what the status is. Feel free to note any issues here |
Thanks, we will test with the latest version and will fix things as needed and send you a pull request. |
@maziminke my first check shows there seems to be a problem with saving the json data for plugins. Seems its a Lime issue, I'll see where it lies |
Works until 3.15.1 |
this one breaks it |
This is a further development of a PR started here #632:
The initial idea was to allow template to be changed to participants via plugin events. Existing events did not work to effectively change the template.