Saunt Valerian
Expert
Member of the Month
Member Likes (0)
There seems to be fundamental bug or issue with Domain Mapping and ajax.
I came across it when I was setting up a Q&A site using the Q&A plugin. Everything was working fine, but when I added a unique domain name to it, all the ajax started throwing call undefined errors.
Here the thread where I talked about and another member offered a solution: This is probably an ajax issue that is currently part of using mu and domains. It has to do with loading ajax-admin.php - it can't find it. The fix I found was to disable remote login, and allow the dashboard for that website to use the mapped domain instead of the original subdomain. Check your error console when you try to activate the ajax object and you should see something about call undefined. This is something I experience when trying to setup a Q&A site with the Q&A plugin. This is not plugin specific, but an Ajax/domain mapping issue.
I'm not sure what the fix is, it could either be in WP core or perhaps the Domain Mapping plugin (I'm currently using the one from the repository, not WPMU DEV's)
When you change the settings, you will lose login pass through when the site is navigated to from the main site or other sites on the network, but you will gain ajax function.
This is something that should be looked into and considered a significant bug, because the whole point of a MarketPlace network is to enable seamless shopping across websites without having to constantly login.
Reference: http://premium.wpmudev.org/forums/topic/voting-not-working-getting-ajax-related-error
This came to mind again this morning when I spotted another thread featuring the same type of issue, but this time with the MarketPress plugin: http://premium.wpmudev.org/forums/topic/domain-mapping-and-marketpress-compatibility-in-31-on-subdomain-install
Whenever a unique domain us mapped to a subdomain install, the ajax fails because it cannot find admin-ajax.php because it is looking for it here: subdomain.mydomain.com/wp-admin/admin-ajax.php but it returns a GET undefined error. The only way to get ajax to work is to set allow the dashboard for that particular site to use the mapped domain instead of the original domain, which creates a problem. It also forces a disabling of remote login. Without remote login, login pass-throughs don't happen as users browse the network, they then have to login again to use the site when they get to it.
Now, I am reporting this as the behavior of the domain mapping plugin from the plugin repository (http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/). I admit haven't switched over to WPMU DEV's domain mapping plugin yet because of the labor involved and the inconvenience that it brings to my users. I do not know how WPMU DEV's domain mapping plugin behaves in this regard and I'm hoping that someone will fill me in - if I am going to make the switch and attempt to get everyone on board with it, then I need to know all the facts before I do.
Responses (7)
Member (joined April 2009) Likes (0)
Hiya Saunt Valerian,
Thanks for the detailed explanation of what's going on here. I've alerted a couple of our developers to come in and take a look. They're respond with some options here and we are actively working on the domain mapping plugin with some improvements as well.
Just as a note, our domain mapping plugin should be compatible with the one on wp.org I don't believe there's anything special that has to be done to transition from one to the other - although I admittedly haven't tested this in awhile. Can anyone confirm?
Thanks!
Lead Developer (joined May 2009) Likes (0)
We recommend setting domain mapping to whatever the user enters. I think our domain mapping plugin actually forces this option for just admin Ajax. If not yet it's slated for the next release.
Member (joined January 2011) Likes (0)
I'm having problems with Domain mapping and Ajax with the Front End Editor plugin... someone also had similar problem here: http://wordpress.org/support/topic/ajax-in-subsite?replies=5
The solution for them was:
any idea how this is done for the WPMU Domain remapper?
thanks
Member (joined January 2011) Likes (0)
From: http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-wp-mu-domain-mapping-problem-with-ajax-request-from-the-all-in_one-event-caledar?replies=5
Is this sensible?
Member (joined January 2011) Likes (0)
Ok - Found this... Looks very complicated though:
http://wordpress.org/support/topic/empty-ajax-response-multisite-fix?replies=3
Support Kangaroo (joined March 2011) Likes (0)
Greetings noriise,
Thank you for being a WPMU Dev member!
Logged in to the network dashboard go to Setting --> Domain Mapping --> category Administration mapping and you will find the choices as outlined in the graphic below.
Our lead developer Aaron said "We recommend setting domain mapping to whatever the user enters. I think our domain mapping plugin actually forces this option for just admin Ajax. If not yet it's slated for the next release."
This is what mine is set for and I have not had any issues.
Saunt Valerian said "The only way to get ajax to work is to set allow the dashboard for that particular site to use the mapped domain instead of the original domain, which creates a problem." but from what I can tell he does not mention what that problem may be.
Therefore the setting NOT to choose is use original domain which is circled in red below.
Cheers, Joe :-)
Due to the fact that the lead developer has been made aware of the issue, acknowledged it has been slated to be addressed, and though not ideal temporary work a-rounds have been addressed, there is no longer any reason to keep this ticket open for further discussion but definitely a useful reference.
Member (joined January 2011) Likes (0)
I just ended up using the Domain Remapper that is in the wordpress repository and not the WPMU one.
WordPress Questions?
We've got answers!
Find out more »