• I am using wordpress 4.0, localhost, WP MVC for plugin development.

    I have a plugin named W2Store. It has three controllers, Countries, Currencies, Zones.

    All the three were mereged into one single admin menu Mystores and the index page is working.
    I have added a link to add a new record in each of the controller’s page and when i click that link, i get this error.
    I tried all methods given in the forums and online helps and still couldn’t find a solution to this mess.

    Below is the code i have written in in w2-store/app/views/admin/layouts/admin.php :

    <div class="wrap">
    
    <?php $this->display_flash(); ?>
    
    <?php $controller = $this->name; ?>
    
    <?php $this->render_main_view(); ?>
    
    <?php echo $this->name; ?>
    
    <?php
    
    	$name = $this->name;
    	if($name = 'admin_countries') {
    		$controller = 'countries';
    		echo '<a href="admin.php?page=mvc_countries-add">Add New</a>';
    	}
    	elseif ($name = 'admin_currencies') {
    		$controller = 'currencies';
    		echo '<a href="admin.php?page=mvc_currencies-add">Add New</a>';
    
    	}
    	elseif ($name = 'admin_zones') {
    		$controller = 'zones';
    		echo '<a href="admin.php?page=mvc_zones-add">Add New</a>';
    
    	}
    
    ?>
    </div>

    can any one suggest me a solution?
    Thankyou very much.

Viewing 1 replies (of 1 total)
  • Thread Starter Prabhu Bakiyaraj Chelladurai

    (@prabhuchelladurai)

    I solved this for myself.

    The reason i got this error was because i have added a custom menu in bootstrap.php and it was in conflict with the permissions. I just removed the unwanted menu item and the error was no more.

    to be more clear,

    I have a custom menu in my bootstrap.php like this:

    MvcConfiguration::append(array(
      'AdminPages' => array(
            'countries' => array(
         'in_menu' => true,
            'parent_slug' => 'mvc_mystores'
              ),
    	'mystores' => array(
    			'countries',
    			'currencies',
    			'zones'
            )
      )
    ));

    in the above code, the following lines served no purpose but was promptly generating error message which is our topic of discussion:

    'countries' => array(
         'in_menu' => true,
            'parent_slug' => 'mvc_mystores'
              ),

    I just removed that.

    Now its okay.

    Thanks everyone.

Viewing 1 replies (of 1 total)
  • The topic ‘You do not have sufficient permissions to access this page.’ is closed to new replies.