Support » Plugin: User Role Editor » Not working with Gravity Forms

  • Resolved musicforte

    (@musicforte)


    I get an error in admin when User Role Editor is activated. It points to Gravity Forms:

    Notice: Undefined index: permission in /home/osakagre/public_html/wp-content/plugins/gravityforms/gravityforms.php on line 1314

    They said the problem was not on their end. The line the error references is:
    if ( is_array( $addon_menus ) ) {
    foreach ( $addon_menus as $addon_menu ) {
    add_submenu_page( esc_html( $parent_menu[‘name’] ), esc_html( $addon_menu[‘label’] ), esc_html( $addon_menu[‘label’] ), $has_full_access ? ‘gform_full_access’ : $addon_menu[‘permission’], esc_html( $addon_menu[‘name’] ), $addon_menu[‘callback’] );
    }
    }

    Is there a way to make this work with Gravity Forms? I’m not sure from where the problem stems.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vladimir Garagulia

    (@shinephp)

    I’m sure that this issue is related to some active Gravity Forms add-on which became incompatible with the current version of the core Gravity Forms. Re-check GF add-ons which you have at your installation.

    If you will look at few lines above (line #1280), gravityforms.php, you will see:

    
    $addon_menus = array();
    $addon_menus = apply_filters( 'gform_addon_navigation', $addon_menus );
    

    User Role Editor does not work with Gravity Forms add-ons in any way. It does not use ‘gform_addon_navigation’ filter to change $addon_menus array.

    Why this warning appeared with active User Role Editor? User Role Editor shows to Gravity Forms that it can use more advanced user permissions models, based on the multiple user capabilities instead of the singe ‘gform_full_access’.

    If you wish to use User Role Editor with Gravity Forms together, but do not wish to use detailed user permissions for GF, then just add new capability ‘gform_full_access’ and grant it to ‘administrator’ role (should be granted to it automatically after adding). This warning will be hidden after that, I suppose.

    Look at the GF code, file gravityforms.php,from line #1139, for more details:

    
    if ( ! self::has_members_plugin() ) {
    	//give full access to administrators if the members plugin is not installed
    	if ( current_user_can( 'administrator' ) || is_super_admin() ) {
    		$all_caps['gform_full_access'] = true;
    	}
    } else if ( current_user_can( 'administrator' ) || is_super_admin() ) {
    ...
    

    User Role Editor simulates for Gravity Forms the presence of Members plugin in order to provide users ability to use advance GF permissions model without installing Members plugin.

    Thread Starter musicforte

    (@musicforte)

    Great plugin and great support! Thank you! That fixed the problem for me! šŸ™‚

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not working with Gravity Forms’ is closed to new replies.