View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
10571Feature requestsPluginspublic2016-06-06 15:41
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Summary10571: beforeController event
Description

It's great to havbe a beforeController everywhere : any plugin can use own view and product page using LS.

Additional Information

Actaully : we have beforeSurveyPage happen for survey. In 2.05 this happen for a lot of public part. But in 2.50 : this only happen for survey, not for survey listing or admin page.

Think adding a new event everywhere X times is a bad idea, but add ONE event every time is better.

This event can send

We can use afterPluginLoad BUT : when afterPluginLoad not whole LS is loaded : for example Permission model is totally broken at this part (tested)

We have actually Piwik-for-Limesurvey working with afterPluginLoad but have some issue https://github.com/SteveCohen/Piwik-for-Limesurvey/issues/14

Think the best place is here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/LSYii_Controller.php#L140

Send a controller made for potentially replacing survey listing with some plugin (using App()->end() in plugin)

TagsNo tags attached.
Attached Files
HomeController.php (1,179 bytes)   
<?php
/**
 * Description
 *
 * @author Denis Chenu <denis@sondages.pro>
 * @copyright 2015 Denis Chenu <http://www.sondages.pro>
 * @license GPL v3
 * @version 0.0.1
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
    class HomeController extends LSYii_Controller
    {
        public $layout = 'bare';
        public $defaultAction = 'index';

        public function actionIndex($sid = null)
        {
            App()->getPluginManager()->loadPlugins();
            $oEvent = new PluginEvent('beforeHomePage');
            $oEvent->set('controller',Yii::app()->controller()->getId());
            App()->getPluginManager()->dispatchEvent($oEvent);

            $this->forward("surveys/publicList");
        }
    }
HomeController.php (1,179 bytes)   
Bug heat2
Story point estimate
Users affected %

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-02-24 10:03

developer   ~35637

PS : in 2.06 : loadPlugin don't happen for survey listing (and surely 404 too)

DenisChenu

DenisChenu

2016-04-22 08:19

developer   ~37670

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=18680

DenisChenu

DenisChenu

2016-04-22 12:06

developer   ~37686

Need in 3.0 too

Related Changesets

LimeSurvey: master 2adc40df

2016-04-20 08:09:39

DenisChenu

Details Diff
New feature 10571: beforeController event (for web)
Dev: use Yii beforeControllerAction function
Dev: send controller+action, other params can be found via API
Dev: Can set run to false to deactivate default action
Dev: better system than afterPluginLoad of 2.05 hack plugin
Affected Issues
10571
mod - application/core/LSYii_Application.php Diff File

LimeSurvey: master ecdfce38

2016-04-22 06:19:02

DenisChenu

Details Diff
Merge pull request #481 from Shnoulle/master_beforeController_event

New feature 10571: beforeController event (for web)
Affected Issues
10571
mod - application/core/LSYii_Application.php Diff File

Issue History

Date Modified Username Field Change
2016-02-24 10:02 DenisChenu New Issue
2016-02-24 10:02 DenisChenu File Added: HomeController.php
2016-02-24 10:03 DenisChenu Note Added: 35637
2016-04-20 11:00 DenisChenu Assigned To => DenisChenu
2016-04-20 11:00 DenisChenu Status new => assigned
2016-04-22 08:19 DenisChenu Changeset attached => LimeSurvey master 2adc40df
2016-04-22 08:19 DenisChenu Changeset attached => LimeSurvey master ecdfce38
2016-04-22 08:19 DenisChenu Note Added: 37670
2016-04-22 08:19 DenisChenu Resolution open => fixed
2016-04-22 12:06 DenisChenu Note Added: 37686
2016-04-22 12:06 DenisChenu Status assigned => resolved
2016-04-22 12:06 DenisChenu Fixed in Version => 2.5+
2016-06-06 15:41 c_schmitz Status resolved => closed