Deslash preference has no effect

james.cartledge - December 17, 2008 - 10:33
Project:Global Redirect
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:nicholasThompson
Status:closed
Description

In the 6.x-1.1 release, the deslash preference set by the user is not honoured - deslashing is always performed.

To reproduce:
1. Navigate to admin/settings/globalredirect
2. Set Deslash to Off and click Save Configuration.
3. Confirm Deslash is now set to Off.
4. Click in the browser location field and add a slash to the end of the url e.g. admin/settings/globalredirect/
5. Press enter.

Expected result:
The URL in the location field ends admin/settings/globalredirect/

Actual result:
The URL in the location field ends admin/settings/globalredirect

There are three bugs contributing to the problem - the attached patch fixes them (I think.)

1. In globalredirect.admin.inc, 'deslash' is spelt 'deslah' in 2 places causing the database variable to be created with the wrong name. This means that later attempts to look up the variable with the correct name always return the default value ("-1".)

2. variable_get returns the variable as a string - "-1" - which evaluates to true in PHP. This is then cast to a bool which is always true. FIX: compare the value returned to GLOBALREDIRECT_FEATURE_DISABLED.

3. Some deslash logic in globalredirect.module does not take into account the user's preference. FIX: Check the user's preference before deslashing.

Please test.

AttachmentSize
deslash.patch2.35 KB

#1

james.cartledge - December 17, 2008 - 20:23
Status:active» needs review

#2

nicholasThompson - December 22, 2008 - 09:38
Version:6.x-1.1» 5.x-1.x-dev
Priority:normal» critical
Assigned to:Anonymous» nicholasThompson
Status:needs review» patch (to be ported)

Fixed in 6.x-1.x-dev. Will be in next major release.

Thanks very much for pointing this out.

Fix needs porting to DRUPAL-5 branch too...

#3

nicholasThompson - December 22, 2008 - 11:23
Status:patch (to be ported)» fixed

Applied fixes to DRUPAL-5 - will be in next major release.

#4

System Message - January 5, 2009 - 11:30
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.