Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
When the config of the multilanguage is set by Path prefix en/, fr/, .. the redirection when i click on the remove link of the coupon is not correct.
I try to patch this.
Sébastien
Comments
Comment #1
sebyoga CreditAttribution: sebyoga commentedCan you review this patch ?
Comment #2
pcambraThanks for reporting this and the patch but I think is better just to add the language in the l that is returned:
Or pass $dest through url using language
Comment #3
xiukun.zhou CreditAttribution: xiukun.zhou commentedI have a similar problem
Comment #4
xiukun.zhou CreditAttribution: xiukun.zhou commentedComment #5
xiukun.zhou CreditAttribution: xiukun.zhou commentedSorry patch name is error.
Comment #6
maijs CreditAttribution: maijs commenteddestination
variable for Remove link is wrong if form is returned via Ajax request.$GLOBALS['base_url']
already contains base path in it, so if site is located under subdirectory, then base path is added twice, hence the redirection back to the home page.The attached patch fixes the destination for Remove link if form is served via Ajax call even if language prefix is present.
Comment #7
Khumbu CreditAttribution: Khumbu commentedthis also exist in 7.x-2.0-beta4 applying the patch manually fixes the issue....
Comment #8
harrrrrrr CreditAttribution: harrrrrrr commentedreroll against current dev
Comment #10
harrrrrrr CreditAttribution: harrrrrrr commentedComment #16
maxplus CreditAttribution: maxplus commentedThanks,
worked for me, not getting a 404 anymore after removing a discount in a multilingual site
Comment #17
GoZ CreditAttribution: GoZ at Centarro commentedI don't have cases using Ajax call, but i have same issue without ajax.
Should use drupal_get_destination() instead of current_path().
May be this works for Ajax call to ?
Comment #18
GoZ CreditAttribution: GoZ at Centarro commentedComment #20
dpolant CreditAttribution: dpolant commentedThe last patch seems to solve this problem. Committed to dev.
Comment #22
harrrrrrr CreditAttribution: harrrrrrr commentedThe code in dev version doesn't work.
I think
if (module_exists('language')) {
should be
if (module_exists('locale')) {
Comment #23
getu-lar CreditAttribution: getu-lar as a volunteer commented@harrrrrrr is right. The fix for https://www.drupal.org/node/2512894 which was released with rc2 breaks this again. As far as I can tell, there is no "language" module, so the check will always return false - it certainly does in my multilanguage sites. The function language_url_split_prefix is defined in includes/language.inc (part of Drupal core) which is loaded as part of the bootstrapping process in includes/bootstrap.inc:2682 (drupal_language_initialize).
Assuming, that the core guys know what they are doing, I would suggest that we test for the availability of the function the same way that they check if they have to load the include - using drupal_multilingual() function which in turn checks the variable 'language_count'.
Comment #24
bessone CreditAttribution: bessone commentedPatch on #23 fixed it, drupal_multilingual() seems ok to see if there are more active languages
Comment #26
dpolant CreditAttribution: dpolant commentedThis seems to do the trick. Committed.