0

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 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

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.

0

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 were 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.