WordPress.org

Support

Support » Plugins and Hacks » Jetpack by WordPress.com » [Resolved] editable roles / Statistic failure

[Resolved] editable roles / Statistic failure

  • After installing the update I gat this failure:

    Fatal error: Call to undefined function get_editable_roles() in /srv/http/xyz.com/wp-content/plugins/jetpack/modules/stats.php on line 219

    After going into the backend and reloading the statistic configuration everything is ok again on the frontend.

    Please correct the failure!

    http://wordpress.org/extend/plugins/jetpack/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Same problem here too.

    same here, fast search say get_editable_roles() is only since WordPress 3.6

    For now I just renamed jetpack folder, and site is woking, but i don’t have jetpack xD

    quick fix:

    if(!function_exists( 'get_editable_roles' )){
    function get_editable_roles() {
      global $wp_roles;
      $all_roles = $wp_roles->roles;
      $editable_roles = apply_filters('editable_roles', $all_roles);
      return $editable_roles;
    }
    }

    Plugin Contributor Andy Skelton

    @andy

    I must apologize for the bug. I didn’t realize that get_editable_roles function is only loaded in admin, making it potentially unsafe to call from stats_upgrade_options when the next page load after upgrade is a non-admin page. The fix has been committed to the Jetpack plugin. The next bugfix release will include this.

    Meanwhile, you should be able to work around the issue by loading just one wp-admin page after upgrading the plugin. This should trigger stats_upgrade_options.

    Would the quick fix go in the functions file or in Jet Pack plugin itself?

    When I’m logged into admin my site works, but when I’m not logged in, my entire site generates the error. I don’t understand what it means just to load one wp-admin page after upgrade.

    My site is here:
    http://www.shadowofiris.com

    Please help.

    Okay, I figured it out, you go to Jetpack/module/stats and edit the function that is centered on line 219 … that seems to be working. Thank you.

    @shadowofiris what do you mean by “fix it”?

    @jmeeter:

    Some of the pages on my site were generating the error given at the start of this thread:
    “Fatal error: Call to undefined function get_editable_roles() in /srv/http/xyz.com/wp-content/plugins/jetpack/modules/stats.php on line 219”

    I went to jetpack folder, module folder, stats file, and replaced the function that centers around line 219 with the code provided by Umbrovskis.com. After doing this the problem seems to have gone away.

    I just added this codes and it started to working

    function get_editable_roles() {
        global $wp_roles;
    
        $all_roles = $wp_roles->roles;
        $editable_roles = apply_filters('editable_roles', $all_roles);
    
        return $editable_roles;
    }
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] editable roles / Statistic failure’ is closed to new replies.
Skip to toolbar