Issue Details (XML | Word | Printable)

Key: CRM-4234
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed/Completed
Priority: Trivial Trivial
Assignee: Piotr Szotkowski
Reporter: Tom Kirkpatrick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
CiviCRM

Drupal path prefix for multilingual sites should be retained throughout CiviCRM.

Created: 11/Mar/09 06:05 PM   Updated: 23/Dec/09 06:58 AM
Component/s: CiviContribute
Affects Version/s: 2.2.0
Fix Version/s: 3.1

Time Tracking:
Not Specified

File Attachments: 1. Text File civicrm-path-prefix-v2.patch (0.8 kB)
2. Text File civicrm-path-prefix.patch (0.9 kB)
3. Text File civicrm_3.0-beta4-local-path-prefix.patch (1 kB)



 Description  « Hide
Following the response I received from dlobo on IRC about my forum message here http://forum.civicrm.org/index.php/topic,7003.msg30829.html#msg30829, the attached patch alters $config->userFrameworkBaseURL to include the path prefix if set in a multilingual Drupal site setup..

I haven't tested extensively, but it does appear to be working without problems

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Donald A. Lobo added a comment - 11/Mar/09 07:46 PM

this patch wont really work on default install. the language variable is always set, even on default installs which dont use prefixing

stdClass Object
(
    [language] => en
    [name] => English
    [native] => English
    [direction] => 0
    [enabled] => 1
    [plurals] => 0
    [formula] =>
    [domain] =>
    [prefix] =>
    [weight] => 0
    [javascript] =>
)

lobo

Tom Kirkpatrick added a comment - 11/Mar/09 08:11 PM
Good call. This version of the patch whould correct that, though I don't have another, single language CiviCRM setup handy to test

Piotr Szotkowski added a comment - 16/Mar/09 11:36 AM
I modified the patch a bit and applied in r20301 for 2.2.1 - thanks a lot for the contribution!

Piotr Szotkowski added a comment - 17/Mar/09 11:38 AM
Aaaargh, not fixed. Apologies.

Piotr Szotkowski added a comment - 11/May/09 02:06 PM
I'm sorry, but I couldn't fix it for 2.2.3 (and we want to release it tomorrow-ish). I'll fix this for 2.2.4 (provided I find the elusive issue that manifests itself on civicrm.org but not in my sandbox...).

Piotr Szotkowski added a comment - 27/May/09 06:24 AM
Moving to 2.3, as we're too close to 2.2.4 and last time the fix, while seemingly simple, broke a few things. I'll fix this as a part of my GSoC work and backport to a future 2.2 release if deemed safe.

Piotr Szotkowski added a comment - 24/Aug/09 12:56 PM
Finally fixed in r23411 - after debugging it thoroughly, the problem was that Drupal not only sets the global $language object's prefix property, but also the language_negotiation config variable, and it must be set to either LANGUAGE_NEGOTIATION_PATH_DEFAULT or LANGUAGE_NEGOTIATION_PATH for Drupal to properly route the language-prefixed URLs.

Kiran Jagtap added a comment - 25/Aug/09 04:06 PM
If we switch Drupal prefix we need to rebuild menus.

Tom Kirkpatrick added a comment - 22/Sep/09 04:05 PM
This patch applies to 3.0-beta4 and ensures that path prefixing is only done if local module is enabled. This is needed for the case where locale was once enabled, and path prefixes were used but local has since been disabled (but not uninstalled). Without this patch, the presence of variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) alone was enough to triger the path prefixing.

Piotr Szotkowski added a comment - 29/Sep/09 02:52 PM
Thanks, Tom - your patches are most appreciated! Lobo applied your patch to 3.0 in r23744, we keep this issue open for 3.1 as we also need to rebuild menus on Drupal language switch (Kiran's last comment).

Piotr Szotkowski added a comment - 06/Nov/09 02:03 PM
Actually, the gist of the issue (retaining language prefix) is fixed and working. We have a separate issue for inheriting language from Drupal/Joomla!: CRM-5027

Yashodha Chaku added a comment - 09/Nov/09 06:30 AM
assigning for 3.1 verification

Piotr Szotkowski added a comment - 23/Dec/09 06:58 AM
Verified for 3.1 in r25645.