Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hello,

I've encountered a problem with admin login when both Extended Users module and PrettyURLS are enabled.
As we all know, Extended Users forces a redirection to the frontend's default User Login page. When Multilang module is enabled, it automatically adds the language code:

Code: Select all
https://[site link]/midgard  -->  https://[site link]/users/login.php?redirect=%2Fmidgard%2F&lc=en

(/midgard is my admin folder name, instead of the default /couch).

But the problems occurs when PrettyURLS are also enabled:

Code: Select all
https://[site link]/midgard  -->  https://[site link]/users/login/?redirect=%2Fmidgard%2F (404 ERROR)


I figured it must be caused by the lack of the language prefix in the redirected URL, as the correct & working URL would be:
Code: Select all
https://[site link]/EN/users/login/?redirect=%2Fmidgard%2F


...but I don't know how to add it automatically into the redirection rule :/

Thanks in advance!
Peter, does the link work without leading slash e.g.
https://[site link]/users/login/?redirect=midgard%2F
trendoman wrote: Peter, does the link work without leading slash e.g.
https://[site link]/users/login/?redirect=midgard%2F

Nope, also 404 error :)
theV wrote:
trendoman wrote: Peter, does the link work without leading slash e.g.
https://[site link]/users/login/?redirect=midgard%2F

Nope, also 404 error :)

I see.. I wish I had some time on hands and a test setup to work on pretty-urls + multi-lang, but I am not at capacity at the moment to recreate a demo to work with. I found files on my pc that indicate I worked on this exact problem – a combination of routable templates, multi-lang addon, lc-links, and rewrites – back in 2018-2019. I guess there were not so many people doing multi-lang sites, but obviously I was among them as a non-english speaker.. Some problems were identified and @KK commited my fixes to Couch, but not all problems were identified as we can see from your post. Maybe @KK has something to say here. :)
trendoman wrote: I see.. I wish I had some time on hands and a test setup to work on pretty-urls + multi-lang, but I am not at capacity at the moment to recreate a demo to work with. I found files on my pc that indicate I worked on this exact problem – a combination of routable templates, multi-lang addon, lc-links, and rewrites – back in 2018-2019. I guess there were not so many people doing multi-lang sites, but obviously I was among them as a non-english speaker.. Some problems were identified and @KK commited my fixes to Couch, but not all problems were identified as we can see from your post. Maybe @KK has something to say here. :)

Thanks a lot, I'll take a look at the things You mentioned - if by some luck I find a solution, I'll be sure to post it here :)
Best regards,
Peter
I now discovered the same issue happens when e.g. adding products to cart:
the <cms:pp_product_form /> lacks the language prefix when used with PrettyURLs and MultiLang.

Are there any chances for some fixes to this? I know it may be of little popularity, to use such a combo (shop + prettyURLs + multilang).

EDIT:

Another idea I've now had... Is it possible to override the Pretty URLS module so that it leaves certain templates intact? I mean, like the whole site having the URLs rewritten, but eg. cart/ and users/ templates still having original URLS (with lc=en suffix). That could solve all the trouble - for now, I had to disable the PrettyURLs in these shops, because the whole cart system broke apart :/
Yeah, this combo looks rarely used. Did you try to contact @KK directly?
trendoman wrote: Yeah, this combo looks rarely used. Did you try to contact @KK directly?

I'll be buying commercial licenses for these 2 domains this or next week (as soon as I got the money transfers from clients), so I'm waiting for that to write KK and ask for help as a premium support issue (especially as I suppose this may be a pretty tough bug to eliminate).
@theV,

Following the discussion we had via PM, I have tried to rectify this problem of 'multi-lang' addon not playing well with 'extended-users' and 'cart' addons.
It required making changes to the 'multi-lang' and 'cart' addon ('extended-users' addon did not require any modification).

The updated 'multi-lang' addon can be found in its original thread at viewtopic.php?f=5&t=10979&p=28231#p28231

The updated cart (cart.php) can be found in the current release of Couch at GitHub - https://github.com/CouchCMS/CouchCMS/tr ... ddons/cart

Using the two updated items mentioned above should fix the issue; just make sure about the following point -
IMP: in your kfunctions.php file where you activate the addons, make sure to put the 'multi-lang' addon *above* the other two e.g. as follows -
Code: Select all
require_once( K_COUCH_DIR.'addons/multi-lang/multi-lang.php' );
require_once( K_COUCH_DIR.'addons/cart/cart.php' );
require_once( K_COUCH_DIR.'addons/extended/extended-users.php' );

Hope this helps.
9 posts Page 1 of 1