When using special chars, for example scandinavian ä,ö or å, in theme Switching Rule Chain. Theme does not get switched.
Example: drupal:path = path/äbc/% >>> exampleTheme

Comments

tungscit’s picture

Assigned: tungscit » Unassigned
tungscit’s picture

Assigned: Unassigned » tungscit
tungscit’s picture

Version: 6.x-3.5 » 6.x-3.x-dev
Component: Miscellaneous » Code / API
tungscit’s picture

Component: Code / API » Modules

The issue is caused by encoded request_uri() which lead to non-matching theme switching rule.
For example:
- if the theme switching rule chain includes drupal:path = path/äbc/% >>> exampleTheme
- User access http://www.example.com/path/äbc
- themekey_match_path() try to find a matching rule by using request_uri() to compare with db rul chain value
- request_uri() will return path/%C3%A4bc which of course will never match with db rule chain value

tungscit’s picture

Using urldecode before comparing path alias with db path chain value should fix the issue.
Attached is the patch.

tungscit’s picture

Status: Active » Needs review
tungscit’s picture

Assigned: tungscit » Unassigned
mkalkbrenner’s picture

Version: 6.x-3.x-dev » 6.x-3.5
Component: Modules » Miscellaneous
StatusFileSize
new436 bytes

You're right. But I'm concerned about backward compatibility. It could be that users already use urlencoded paths in their ThemeKey rules. And there's a difference between urlencode and rawurlencode.

What do you think about this variant of the patch?

tungscit’s picture

Status: Needs review » Patch (to be ported)

Yes, I think your patch is better. Tested and the problem is fixed. Thanks a bunch!

mkalkbrenner’s picture

Assigned: Unassigned » mkalkbrenner
Status: Patch (to be ported) » Fixed

committed to 6.x and 7.x

Status: Fixed » Closed (fixed)

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