Open herrvigg opened 6 years ago
Comment by unfulvio Monday Oct 31, 2016 at 04:27 GMT
update:
this is the line in pre_get_posts
qtranslate callback that causes a compatibility issue with Memberships:
$query->query_vars['suppress_filters'] = false;
I tried to change the priority of qtranslate filtering pre_get_posts
or the one in Memberships but that didn't seem to do any better
Memberships needs to do add_filter()
or remove_filter()
for pre_get_posts
to add or remove its own filter - would a similar approach work in qTranslate to do its thing?
Issue by unfulvio Friday Oct 28, 2016 at 15:37 GMT Originally opened as https://github.com/qTranslate-Team/qtranslate-x/issues/449
Hello there,
when WooCommerce and WooCommerce Memberships are active in a site running qtranslate-x (either with or without qtranslate-x WooCommerce counterpart) and WooCommerce Memberships is set to hide all restricted content, when a member of a plan that should get access to the restricted visits a restricted post a server error is issued (502 Bad Gateway on nginx).
If Memberships restrictions are other than hide all content, then it seems to be working.
Memberships hooks
pre_get_posts
to turn the content into 404 for non-members (which seems to be working fine). It's not clear why logged in members who would access the unfiltered content normally hit a server error.I've pinpointed the problem with this code in qtranslate at https://github.com/qTranslate-Team/qtranslate-x/blob/3.4.6.9/qtranslate_frontend.php#L545-L557
if I comment out
add_action( 'pre_get_posts', 'qtranxf_pre_get_posts', 99 )
the server error goes awayany suggestions for achieving compatibility between the two plugins here?
many thanks