• Resolved itnmario

    (@itnmario)


    Hi,

    after the last update to version 1.6 it is not possible to edit / view the inbound messages (even if logged in as an administrator).

    The list of messagges is there but no link to the message is provided.

    If I try to open the message manually with /wp-admin/admin.php?page=flamingo_inbound&post=XXX&action=edit I get a “no permission to open” error.

    So I think there is an issue with the role’s capability (as I said I am using an administrator account).

    Thank you for your great plugin!

    • This topic was modified 7 years, 5 months ago by itnmario.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins and theme do you use?

    Thread Starter itnmario

    (@itnmario)

    Hi @takayukister and thanks for your answer!

    I have found the problem. The theme was using a filter to permit the authors to access flamingo.

    remove_filter( 'map_meta_cap', 'flamingo_map_meta_cap' );
    add_filter( 'map_meta_cap', 'mycustom_flamingo_map_meta_cap', 9, 4 );
    
    function mycustom_flamingo_map_meta_cap( $caps, $cap, $user_id, $args ) {
        $meta_caps = array(
            'flamingo_edit_contacts' => 'publish_posts',
            'flamingo_edit_contact' => 'publish_posts',
            'flamingo_delete_contact' => 'publish_posts',
            'flamingo_edit_inbound_messages' => 'publish_posts',
            'flamingo_delete_inbound_message' => 'publish_posts',
            'flamingo_delete_inbound_messages' => 'publish_posts',
            'flamingo_spam_inbound_message' => 'publish_posts',
            'flamingo_unspam_inbound_message' => 'publish_posts' );
    
        $caps = array_diff( $caps, array_keys( $meta_caps ) );
    
        if ( isset( $meta_caps[$cap] ) )
            $caps[] = $meta_caps[$cap];
    
        return $caps;
    }

    I suppose the new version break the compability to this script. I would really appreciate your help to achive the same goal with the 1.6 version of Flamingo.

    Thank You!

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    What theme is it? Where did you get it from?

    Thread Starter itnmario

    (@itnmario)

    I developed it… it is one custom theme for one client…

    Thread Starter itnmario

    (@itnmario)

    Are you now using objects instead arrays to pass meta caps?

    No… (I checked myself…. ?? )

    • This reply was modified 7 years, 5 months ago by itnmario.

    im using the salient theme, https://themeforest.net/item/salient-responsive-multipurpose-theme/4363266, will see if i can debug the exact problem later

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    OK. I never recommend setting looser capabilities like this, but if you want to do it at your own risk, use this script instead of your current one:

    add_filter( 'flamingo_map_meta_cap', 'custom_flamingo_map_meta_cap' );
    
    function custom_flamingo_map_meta_cap( $meta_caps ) {
    	$meta_caps = array_merge( $meta_caps, array(
    		'flamingo_edit_contact' => 'publish_posts',
    		'flamingo_edit_contacts' => 'publish_posts',
    		'flamingo_delete_contact' => 'publish_posts',
    		'flamingo_edit_inbound_message' => 'publish_posts',
    		'flamingo_edit_inbound_messages' => 'publish_posts',
    		'flamingo_delete_inbound_message' => 'publish_posts',
    		'flamingo_delete_inbound_messages' => 'publish_posts',
    		'flamingo_spam_inbound_message' => 'publish_posts',
    		'flamingo_unspam_inbound_message' => 'publish_posts',
    	) );
    
    	return $meta_caps;
    }

    Hi @takayukister,

    Thanks for the update.

    You recommended this script a while ago to give access to lower roles.
    https://www.ads-software.com/support/topic/flamigo-roles-and-capabilities/#post-3351616

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Cannot open inbound messages after update’ is closed to new replies.