Ken Addams
asked 7 years ago

Hi !
Does DWQA works with multisite activated ? I have a doubt because I juste tried some tests and I state that :
– When calling the Questions list page from the root blog, the filters (by Answered / Resolved / Closed …) work perfectly  (ie webpage like : http://www.mywebsite.com/dwqa-questions/)
– These filters don’t work anymore when called from a site which is not the root one (ie : http://www.mywebsite.com/wpmu-site/dwqa-questions/).
The error message that is shown to the user is the following : “Sorry, but nothing matched your filter.” 
Tests have being done with the same WordPress Theme to prevent theme conflicts.
So anoyne already faced that issue ?
Thank you,
K.A.
 

1 Answers
Guru
answered 7 years ago

dwqa works fine for my multisite! also permanent links need to be resaved after initial setup. Perhaps you need to work on the settings and integrate the template. But there has to be some questions related to the particular category or tag filter.
if still doesnt work, please share your site so we can have abetted idea.

Ken Addams
replied 7 years ago

Hi ! I tried to debug the AJAX queries in inc/filters.php function filter_question() with Chrome.

It appears the following :
– The “posts” array which is sent through AJAX to update the questions table, is always empty *except* for the main site.
– When I try to select a new filter on the main site, no problem. When I try to do the same on a subsite (same config as the main site), there is an error in Apache Error log.

That error message says that “mydbprefix_6_usermeta” table doesn’t exists.

In multisite it seems there is no usermeta for each new blog, only for the main one. That’s why the SQL request returns a list of posts for the main blog (mydbprefix_usermeta exists) but not on sub-sites (mydbprefix_N_usermeta).

So I hard-replaced all the occurences of {$wpdb->prefix}usermeta by mydbprefix_usermeta and now filters work for both the main site and sub sites.

The fact is I don’t know why it works for your multisite config and not for mine. Do you have “usermeta” tables for each of your blogs, or only for the main one ?

Regards,
K.A.

Guru
replied 7 years ago

Well I haven’t really checked that! But I installed the plugin on two different sub sites in different domains and they are working fine for me.

Ken Addams42
replied 7 years ago

Hi !
I have made some investigations and it seems to be a bug that appears on some plugins on some Multisite installations (installs where the database prefix was changed in the wp-config.php).

That’s why there is no impact on some installs and bugs on other installs 🙂

http://wordpress.org/support/topic/multisite-table-prefix-wpdb-prefix-incorrect

WordPress Codex says the universal way to get the usermeta tablename is : $wpdb->usermeta (without $prefix).

Here is another plugin that had the same problem :
http://wordpress.org/support/topic/multisite-setup-gives-usermeta-table-error

Hope this helps,
Regards,
K.A.

Powered by DW Question & Answer Pro