View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 15886 | Bug reports | Plugins | public | 2020-02-18 10:11 | 2026-11-20 15:42 |
| Reporter | dschirge | Assigned To | |||
| Priority | none | Severity | feature | ||
| Status | closed | Resolution | no change required | ||
| Product Version | 3.x | ||||
| Summary | 15886: Plugin development | ||||
| Description | I already wrote several plugins for LS and noticed some problems.
You could do in your implementation the following: class ExamplePlugin extens PluginInterface {
{
} public function executeJavaScript():array {
} public function loadCssFiles():array } Of course there is more you could do this way, it's just a first example. In the background you could change your method for executing the plugins to the following: if ((!isset($this->plugins[$id]) || get_class($this->plugins[$id]) !== $pluginName)) {
class MyPluginToolMenuItem implements MaskExtensionInterface This is of course a very simple example and maybe not enough for a "mask extension". But if you would develop a system I suggested you would take back the control from the plugin developer to LS. Please let me know your thoughts. | ||||
| Tags | No tags attached. | ||||
| Bug heat | 12 | ||||
| Complete LimeSurvey version number (& build) | |||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | |||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | |||||
| Git branch / Pull Request URL | |||||
|
@DenisChenu: What do you think about the suggested approach? Wouldn't a proper implementation like this make the plugin sytem more stable and future safe? @ollehar: Who at your development team is responsible for deadling with plugin related details? |
|
|
PHP NameSpace and JS NameSpace ? Then:
It's possible : usage of Yii::setPathOfAlias is the trick
Twig have function, expression manager have own function , and Yii have regsiterScript and registerPackage (personnaly : prefer registerPackage for plugin ..) Else : current LimeSurveyAPI exist but is unusuable. If you want to improve and add more function : please do ... About extend HTML (admin and public) : there are no way. Can be great to have 2 system to add element on any HTML part but please .... no 4 different ways again (like menu ... for example). |
|
|
Hi DenisChenu, I am aware for example of Yii's registerScript. Extending HTML: I don't know of 4 different ways. It like on the points above: LS should decide how to append new HTML. Sorry, but I get the feeling you don't like to get suggestions how to improve LS. I don't criticize anybody here or in HH. No software is perfect, no developer is perfect and a look after some weeks on my own code mostly displays my own imperfection. |
|
|
Else about API stabilization (make the plugin sytem more stable and future safe) : best solution create test : https://github.com/LimeSurvey/LimeSurvey/tree/master/tests/functional/acceptance/15246-fixed-em-function
It's not about your suggestion . In fact : i don't care, because when i create a plugin: a lot of people ask for previous version compatibility ... . My opinion : do it, add a test, add a plugin using it , make the pull request and let's see. About javascript if we talk for javascript : there are official way for theme (admin or public). (config.xml : https://github.com/LimeSurvey/LimeSurvey/blob/ae4638e2b61ea2d0a895459965793048828d8b1a/themes/admin/Sunset_Orange/config.xml#L32 or https://github.com/LimeSurvey/LimeSurvey/blob/ae4638e2b61ea2d0a895459965793048828d8b1a/themes/survey/vanilla/config.xml#L48 etc ...) I don't understand why LimeSurveyAPI need new functions .... because : WHO manage LimeSurveyAPI file ? See 14477: LimeSurvey api createUrl didn't use publicurl setting issue for example. My idea: more function in API => More unresolved bug .... |
|
This is French friendly tone. ;D Yeah, plugin dev is a bit hackish. Usually you can do anything you want, though. Cleaning up the plugin system is not a priority, since there so much to clean in the general code base already. |
|
|
Also note that no new features will be added into LS3, only (more serious) bug fixes. |
|
|
Hi Ollehar, |
|
More and more than dozen .... |
|
|
Yes. In German you express it with dozens. You of course could say tons of tasks but it doesn't change the fact that it's urgent to look at some coding principles - and I maybe would throw in "design patterns" like MVC. |
|
|
Most of this is now possible in current versions:
If you still need a new plugin API, please open a new feature request for that one thing. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-02-18 10:11 | dschirge | New Issue | |
| 2020-02-18 10:16 | Mazi | Issue Monitored: Mazi | |
| 2020-02-18 11:52 | Mazi | Note Added: 56066 | |
| 2020-02-18 12:01 | DenisChenu | Note Added: 56068 | |
| 2020-02-18 12:29 | dschirge | Note Added: 56070 | |
| 2020-02-18 12:44 | DenisChenu | Note Added: 56071 | |
| 2020-02-18 12:45 | DenisChenu | Note Edited: 56071 | |
| 2020-02-26 16:25 | ollehar | Note Added: 56205 | |
| 2020-02-26 16:27 | ollehar | Note Added: 56206 | |
| 2020-02-26 17:58 | dschirge | Note Added: 56207 | |
| 2020-02-26 18:02 | DenisChenu | Note Added: 56208 | |
| 2020-02-26 18:05 | dschirge | Note Added: 56209 | |
| 2026-11-19 22:50 | c_schmitz | Status | new => acknowledged |
| 2026-11-20 15:41 | c_schmitz | Note Added: 87829 | |
| 2026-11-20 15:41 | c_schmitz | Bug heat | 10 => 12 |
| 2026-11-20 15:41 | c_schmitz | Status | acknowledged => resolved |
| 2026-11-20 15:41 | c_schmitz | Resolution | open => @0@ |
| 2026-11-20 15:42 | c_schmitz | Resolution | @0@ => no change required |
| 2026-11-20 15:42 | c_schmitz | Status | resolved => closed |