View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
16378 | Feature requests | Plugins | public | 2020-06-10 23:04 | 2020-11-03 15:59 |
Reporter | gabrieljenik | Assigned To | ollehar | ||
Priority | none | Severity | feature | ||
Status | new | Resolution | fixed | ||
Summary | 16378: New Plugin Event: beforeTokenImport | ||||
Description | Adding a new plugin event "beforeTokenImport" for the csv import, under the tokens controller. | ||||
Additional Information | BeforeTokenImportUsageAllows to update the token details or apply custom validations before importing a token. InputThe event receives the following information:
Possible outputThe following information can be set in the event:
Changes to CodeThe event will fired from the Approximately before line 2171:
The parameters passed to the event will be the following:
After returning from the event, the method will retrieve the output parameters.
The import results view ( For each | ||||
Tags | No tags attached. | ||||
Bug heat | 8 | ||||
Story point estimate | |||||
Users affected % | |||||
related to | 16785 | closed | gabrieljenik | New Plugin Event: beforeTokenImport |
@cdorin, @ollehar: This is a detailed documentation of the plugin event needed for our project. Please review and let us know if we can implement this as outlined. |
|
@DenisChenu Comments? |
|
Can not be done in beforeTokenSave ? In my opinion : if we add event and event and event again without global solution … Or allow update of rules ? And here : when adding a csv : it already take a lot time … adding an event for each lines ? |
|
In onBeforeSave Find good way to set isValid to false and check if we can addError https://www.yiiframework.com/doc/api/1.1/CModel#addError-detail |
|
Hi Denis, I thought about onBeforeSave. The downside of that event is that on its current status:
On the other side, the new event could receive other parameters related to the import process specifically, as type of import, record count, import process params, .. At last, this event shall be included on LSv3 LTS. As that we don't persuit a major feature or a code reorganization, but more an intervention oriented towards adding a validation point within a controlled scope as to minimize errors and regressions. onBeforeSave is very wide for that situation. What do you think? |
|
Unless Denis has any principle counter arguments, I'd say go for it. :) |
|
We must add this :) |
|
|
|
|
|
Sorry, not good with mantis formatting |
|
I have created a new ticket for the before**Save plugin event. Please, let me know if it is OK then to work on a new beforeTokenImport plugin event. Thanks! |
|
About beforeTokenImport : yes, right, hard to see how to create a plugin with current system. But remind : if you can generalise and not create one plugin for each system … |
|
Before starting any work, please make sure that the same feature can be added to LS4. So the same place of the event exists. |
|
PR for LTS: https://github.com/LimeSurvey/LimeSurvey/pull/1485 If ok, will create a different ticket for master |
|
Looks good! |
|
Added the ImportDone parameter as @DenisChenu suggested. |
|
:+1: thank you I don't see the update on pull request ? |
|
Oups … don't see it ate 1st option … |
|
Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30655 |
|
Found a bug. |
|
LimeSurvey: 3.x-LTS 509e2f14 2020-10-23 12:21 Committer: GitHub Details Diff |
New feature 16378: New Plugin Event: beforeTokenImport |
Affected Issues 16378 |
|
mod - application/controllers/admin/tokens.php | Diff File | ||
mod - application/views/admin/token/csvimportresult.php | Diff File | ||
add - plugins/Demo/BeforeTokenImportDemo/BeforeTokenImportDemo.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-06-10 23:04 | gabrieljenik | New Issue | |
2020-06-10 23:05 | gabrieljenik | Additional Information Updated | |
2020-06-11 11:31 | ollehar | Project | Bug reports => Feature requests |
2020-06-11 14:54 | Mazi | Note Added: 58246 | |
2020-06-11 14:59 | ollehar | Note Added: 58247 | |
2020-06-11 15:02 | DenisChenu | Note Added: 58248 | |
2020-06-11 15:04 | DenisChenu | Note Added: 58249 | |
2020-06-11 16:31 | gabrieljenik | Note Added: 58250 | |
2020-06-15 16:18 | gabrieljenik | Note Added: 58290 | |
2020-06-15 16:22 | ollehar | Note Added: 58292 | |
2020-06-15 16:34 | DenisChenu | Note Added: 58293 | |
2020-06-16 20:01 | gabrieljenik | Note Added: 58316 | |
2020-06-16 20:02 | gabrieljenik | Note Added: 58317 | |
2020-06-16 20:02 | gabrieljenik | Note Added: 58318 | |
2020-06-16 21:47 | gabrieljenik | Note Added: 58319 | |
2020-06-17 08:27 | DenisChenu | Note Added: 58322 | |
2020-06-17 12:40 | ollehar | Note Added: 58323 | |
2020-07-16 02:22 | gabrieljenik | Note Added: 58964 | |
2020-07-16 08:59 | Mazi | Note Added: 58965 | |
2020-07-23 21:30 | gabrieljenik | Note Added: 59066 | |
2020-07-24 09:21 | DenisChenu | Note Added: 59069 | |
2020-07-24 09:25 | DenisChenu | Note Added: 59070 | |
2020-10-23 10:21 | ollehar | Changeset attached | => LimeSurvey 3.x-LTS 509e2f14 |
2020-10-23 10:21 | ollehar | Note Added: 60386 | |
2020-10-23 10:21 | ollehar | Assigned To | => ollehar |
2020-10-23 10:21 | ollehar | Resolution | open => fixed |
2020-10-23 14:07 | gabrieljenik | Issue cloned: 16785 | |
2020-10-23 14:07 | gabrieljenik | Relationship added | related to 16785 |
2020-11-03 15:59 | gabrieljenik | Note Added: 60511 |