News:

Looking for documentation? Take a look on our wiki

Main Menu

[ALMOST SOLVED] Multiple domains broken, css & js not loaded

Started by mahagr, May 23, 2008, 13:13:22 PM

Previous topic - Next topic

mahagr

I'm using VM 1.1 + Joomla! 1.5.3 with legacy on.

My site has two domains, one for Finnish content and one for English content.

The problem in VM is: $mosConfig_live_site points to main domain (www.liinalapsi.fi) if I'm using alias domain (www.wearababy.com). This causes vmMainFrame::render() to give wrong parameters to fetchscript.php: subdir[0]=http://www.wearababy.com/themes/default (should be /themes/default).

Because subdir[0] is not valid directory, loading the file fails causing theme to be broken.

This can be fixed by replacing all '$mosConfig_live_site' with 'JURI :: root()', which is the default value for the variable in legacy.php.


After fixing the problem there seems to be security violation in AJAX. There is no permission to call method XMLHttpRequest.open. This is from Opera Error Console:

Event thread: change
Error:
name: Error
message: Security violation

Any ideas how to fix this one?

You can test the error in:

http://www.wearababy.com/shop?page=shop.product_details&flypage=flypage_images.tpl+&product_id=29&category_id=1&lang=en

.. by changing "Please select an item"

PS. Joomla cache is also broken on multiple domains, you can fix it by adding JURI::base() to libraries/joomla/cache/handler/page.php:_makeId():108

mahagr

$mosConfig_live_site causes also other problems, for example you cannot edit your user settings from VirtualMart because of on save you are forwarded to other domain and you don't have a valid session in there.

mahagr

Ok, solved the problem. Ajax call uses $mm_action_url, which is either URL or SECUREURL (defined in administrator/components/com_virtuemart/global.php). Unfortunately this address is different to html base, which causes the Ajax call to fail.

I hacked the code (removed secure url for now), but better fix would be nice to have in the next minor version of VM. I can code it, but I need to know how to handle this problem..