WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Wiki
[resolved] Fatal Error on line 41 right after installation (3 posts)

  1. A2E
    Member
    Posted 3 years ago #

    Just installed the plugin, as soon as I try yo go into the plugin's settings I get

    Fatal error: Call to a member function has_cap() on a non-object in /[deleted]/[deleted]/public_html/wp-content/plugins/wordpress-wiki/controllers/wiki_admin.php on line 41

  2. hellotank
    Member
    Posted 3 years ago #

    你需要修改wordpress-wiki/controllers/wiki_admin.php 这个文件里面的function upgrade_check() 函数,将函数改成
    You need to fix the function upgrade_check() of wordpress-wiki/controllers/wiki_admin.php .The function should be this:

    function upgrade_check() {
    		if ( get_option( 'numberOfRevisions' ) != false ) {
    			return true;
    		} else {
    			$wiki = get_role('wiki_editor');
    			if ( $wiki != null) {
    				if ($wiki->has_cap('edit_posts') ) {
    					return true;
    				}
    			} else {
    				if ($wiki == null) {
    					add_role( 'wiki_editor', 'Wiki Editor', array('read' => true) );
    				}
    				return false;
    			}
    		}
    	}
  3. Matthew Gerring
    Member
    Plugin Author

    Posted 3 years ago #

    Very sorry for the inconvenience! This error is fixed in version 1.0.1 of the plugin which you can download from Github:

    WordPress Wiki Development version

    The new version will be in the WordPress plugin repo shortly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic