View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10252Bug reportsOtherpublic2016-02-03 09:17
Reporterlowprofile Assigned ToDenisChenu  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.06+ 
Fixed in Version2.50.x 
Summary10252: old style (1.92 - 2.05) URL mapping no longer working in 2.06
Description

Up to version 2.05 the old style (1.92) urls were working along with the new style. This is possibly due to controller changes?

old style
http://limesurvey-templates.com/ls2demo/index.php?sid=855647
new style
http://limesurvey-templates.com/ls2demo/index.php/855647

in version 2.06 the old style is no longer working as can be seen in the demo
(this example will prb be wiped)
old style is also not working
http://demo.limesurvey.org/index.php?sid=289271

new style (with get enabled?)
http://demo.limesurvey.org/index.php?r=survey/index&sid=289271
The cleaner URL works in my instance of 2.06 (possibly with get enabled in the config)
/index.php/289271 but its not working in the demo

Steps To Reproduce

Create a survey in 2.06
Go to the url of the new survey
change the url to the old style

/index.php?sid=xxxxxxx

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)2.06 160123
I will donate to the project if issue is resolvedNo
Browserchrome/firefox
Database type & versionMysql
Server OS (if known)redhat
Webserver software & version (if known)apache
PHP Version5.3.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-01-27 09:11

developer   ~34397

Last edited: 2016-01-27 09:13

I have an idea for this.

Add a new plugin event 'beforePublicPage' 'type'=> ... and some information
(using it for beforeSurveyPage too)

Use this event to do a new plugin :
'beforePublicPage'
type=> 'surveylist'

if(App()-getQuery('sid'))
redirect to survey

Deactivate dby default,

name it 'oldUrlCompat'

\o/ i think we can do it without a new event :)

DenisChenu

DenisChenu

2016-01-27 09:29

developer   ~34398

Got it : limesurvey.sondages.pro/index.php?sid=714997

Make the pull request and the plugin today

public function afterPluginLoad()
{
    $oEvent=$this->getEvent();
    $sControllerId=App()->getController()->getId();
    $iSurveyID=App()->request->getQuery('sid');
    if($sControllerId==="surveys" && $iSurveyID)
    {
        // TODO: Redo the $_GET params
        $url=$this->api->createUrl('survey/index', array('sid' => $iSurveyID));
        App()->request->redirect($url);
    }
}

Need to reconstruct the GET parameters (for enterUrl)

DenisChenu

DenisChenu

2016-01-27 12:28

developer   ~34399

Plugin is here : https://github.com/LimeSurvey/LimeSurvey/pull/424
Actaully ion cpore, but can be put in plugins temporary

lowprofile

lowprofile

2016-01-28 20:47

reporter   ~34407

I tested the plugin and while it works with the plugin, the new style URLS no longer work, and the link from the survey details no longer works (since it is a new style link)

DenisChenu

DenisChenu

2016-01-29 08:47

developer   ~34410

@lowprofile : with GET or PATH ?

I test with PATH : seems to have no issue. ANd in teory : it must work with any url. We do something only if controller is surveys (survey listing)

DenisChenu

DenisChenu

2016-01-29 09:52

developer   ~34411

Last edited: 2016-01-29 09:54

@lowprofile :can not reproduce:

path:
newurl : http://testing.sondages.pro/limesurvey/index.php/10000?newtest=Y
oldurl : http://testing.sondages.pro/limesurvey/index.php?sid=10000&newtest=Y

get:
newurl : http://testing.sondages.pro/limesurveyget/index.php?r=survey/index&sid=10000&newtest=Y
oldurl : http://testing.sondages.pro/limesurveyget/index.php?sid=10000&newtest=Y

DenisChenu

DenisChenu

2016-01-29 09:53

developer   ~34412

@lowprofile : waiting for you feedback : find the way to broke this.

DenisChenu

DenisChenu

2016-02-02 12:08

developer   ~34469

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

c_schmitz

c_schmitz

2016-02-03 09:17

administrator   ~34486

2.5+ Build 160202 released

Related Changesets

LimeSurvey: master 19805ae7

2016-01-27 11:27:27

DenisChenu

Details Diff
Fixed issue 10252: old style (pre 2.0) URL mapping no longer working in 2.06
Dev: forward to survey controller if controller is surveys and sid is in GET param
Dev: forward because redirect need query params reconstruction
Dev: use redirect can be an option (or new plugin)
Affected Issues
10252
add - application/core/plugins/oldUrlCompat/oldUrlCompat.php Diff File

LimeSurvey: master eca522b6

2016-02-02 11:08:26

DenisChenu

Details Diff
Merge pull request #424 from Shnoulle/fix_10252_oldUrlCompat

Fixed issue 10252: old style (pre 2.0) URL mapping no longer working…
Dev: still working with 2.5
Dev: not activate by default, can be acativated
Affected Issues
10252
add - application/core/plugins/oldUrlCompat/oldUrlCompat.php Diff File

Issue History

Date Modified Username Field Change
2016-01-26 15:18 lowprofile New Issue
2016-01-27 09:11 DenisChenu Note Added: 34397
2016-01-27 09:13 DenisChenu Note Edited: 34397
2016-01-27 09:28 DenisChenu Assigned To => DenisChenu
2016-01-27 09:28 DenisChenu Status new => assigned
2016-01-27 09:29 DenisChenu Note Added: 34398
2016-01-27 12:28 DenisChenu Note Added: 34399
2016-01-28 20:47 lowprofile Note Added: 34407
2016-01-29 08:47 DenisChenu Note Added: 34410
2016-01-29 09:52 DenisChenu Note Added: 34411
2016-01-29 09:53 DenisChenu Note Added: 34412
2016-01-29 09:53 DenisChenu Status assigned => feedback
2016-01-29 09:54 DenisChenu Note Edited: 34411
2016-01-29 09:54 DenisChenu Note Edited: 34411
2016-02-02 12:08 DenisChenu Changeset attached => LimeSurvey master 19805ae7
2016-02-02 12:08 DenisChenu Changeset attached => LimeSurvey master eca522b6
2016-02-02 12:08 DenisChenu Note Added: 34469
2016-02-02 12:08 DenisChenu Resolution open => fixed
2016-02-02 12:08 DenisChenu Status feedback => resolved
2016-02-02 12:08 DenisChenu Fixed in Version => 2.5
2016-02-03 09:17 c_schmitz Note Added: 34486
2016-02-03 09:17 c_schmitz Status resolved => closed