WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Access Manager
checkAccess Error (4 posts)

  1. whatadewitt
    Member
    Posted 2 years ago #

    Hi,

    I can't seem to figure out why I am getting this error:

    Call to a member function checkAccess() on a non-object in [DIR]\advanced-access-manager\mvb_wp_access.php on line 945

    I'm looking at the code, but I'm really struggling to figure this out...

    Anything you can give me to help out would be a big help.

    v1.5.5 of the plugin just activated...

    --d

    http://wordpress.org/extend/plugins/advanced-access-manager/

  2. WP AAM
    Member
    Plugin Author

    Posted 2 years ago #

    Hi whatadewitt,
    In mvb_wp_access.php file in __construct move the line
    $this->menu = new mvb_Model_FilterMenu($this);
    right under:
    //TODO - Optimize this

    So the code should looks like this:
    public function __construct() {
    global $post;

    //TODO - Optimize this
    $this->user = new mvb_Model_User();
    $this->menu = new mvb_Model_FilterMenu($this);

    I'll fix this issue in release 1.5.6

  3. whatadewitt
    Member
    Posted 2 years ago #

    Thanks Vasyl!

    EDIT: This works!

  4. WP AAM
    Member
    Plugin Author

    Posted 2 years ago #

    whatadewitt,
    Actually this is much better:

    public function __construct() {
    global $post;

    //initialize AAM Settings
    $this->initUserAccessConfig();

    //TODO - Optimize this
    $this->user = new mvb_Model_User();
    $this->menu = new mvb_Model_FilterMenu($this);

    Because otherwise if user is not logged in it'll cause fatal error.
    I almost finished next release. Just prefer to wait few more days for feedback.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic