Hi,
I have experienced the same problem and it seems, there is a conflict between s2Member and WPML plugins.
WPML adds permalink_filters in file sitepress.class.php:
// posts and pages links filters
add_filter(‘post_link’, array($this, ‘permalink_filter’),1,2);
add_filter(‘post_type_link’, array($this, ‘permalink_filter’),1,2);
add_filter(‘page_link’, array($this, ‘permalink_filter’),1,2);
and in the filter itself there is a database query, which causes the error:
function permalink_filter($p, $pid){
global $wpdb;
if(is_object($pid)){
$pid = $pid->ID;
}
$post_type = $wpdb->get_var(“SELECT post_type FROM {$wpdb->posts} WHERE ID={$pid}”);
I suppose, the problem is that $pid is not set … its value gets lost somewhere in the chain of functions listed also in the error message.
For me, this error occured only, when I saved a page in the editor.
A temporary solution is to deactivate s2Member and then activate it again. I suspect some caching problem as it is also in the error message: c_ws_plugin__s2member_cache::cached_page_links
I wrote these details to help s2Member team to figure out the problem…
Cheers,
Attila