Mashup restriction with Role Scope plugin

Home Forums MapPress Support Mashup restriction with Role Scope plugin

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #12171
    jeffreygrant
    Participant

    Hello Chris.

    I just installed the Role Scope plugin and there is an unknown issue with Mashups.  If I am logged in as Admin, then I can see the mashup correctly.  If am not logged in at all, then I see the world map with no POIs.  However, I can see a single map on the same page correctly regardless if I am logged in or not. I can deactivate Role Scope everything works fine as before.

    Do you have any ideas on what role or setting could be causing the mashup to not fire for non logged in users?  I couldn’t find any ideas in the support forum.  I have also scoured the Role Scope support forum for a solution.

    Thanks.

     

    #12196
    Chris
    Keymaster

    Hi,

    I’m sorry, but I don’t know what that plugin does.  One thing that might help: you can try running the query in your template, without MapPress.  That might help to determine if the role plugin is modifying the query somehow.

    Here’s a snippet of PHP that’ll show a query (you can replace it with the query from your mashup):

    <?php 
    $wpq = new WP_Query('post_type=post&posts_per_page=-1');
    echo print_r($wpq, true);
    ?>
    #12261
    amadex
    Participant

    It happens something similar to me… When I’m logged in as administrator I can see the mashup. When I’m  logged in as subscriber I can’t… But I can always see an isolated map… No membership plugins active.

    #12262
    amadex
    Participant

    I’ve just checked that, with the PHP query, I get all the data! The mappress mashup only works when I’m logged in as administrator. Doesn’t work when logged in as any other role or not logged in at all… Any help?!…

    #12263
    Chris
    Keymaster

    @amadex, it’s hard to say without more info, but usually this happens when you’re using draft/private posts that can only be seen while logged in (WP adjusts the query based on your login status).

    Probably the easiest thing is to just send me a URL and login, and tell me where to find your mashup.

    #12267
    amadex
    Participant

    Hi Chris, unfortunately I can’t give access to the site at this stage… Is there anything else I can do to find what’s happening? If I do a PHP wpquery the data is obtained (either not logged in, or logged as subscriber). With the mashup, it stays with the “loading” box and nothing happens… Every page and content is published and not private or draft. I don’t know if it is relevante but I’m doing a mashup over a custom post type, containing custom fields and custom taxonomy.

    #12271
    amadex
    Participant

    @jeffreygrant Hi, did succeeded in making it work not logged as admin?!…

    #12278
    amadex
    Participant

    Hi, I’ve found the problem. I had this in my functions.php:

    ——————————————————–

    add_action( ‘admin_init’, ‘restrict_admin’, 1 );

    function restrict_admin() {

    if ( ! current_user_can( ‘manage_options’ ) ) {

    wp_redirect( site_url() );

    exit;

    }

    }

    ——————————————————–

    Don’t understand why it was interfering with mappress ajax, but this was the cause…

    #12717
    apart
    Participant

    I am just wondering if the original poster ever succeeded in getting this to work. @jeffreygrant?

    I am having a similar issue, and have been unable to find a solution. I did some searches for the code that @amadex discovered, but did not find anything.

    Thanks for anyone’s help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.