Jump to content

AdminController missing or invalid


Recommended Posts

Hello everyone.

I have a custom module that I developed and it works well. I am working on the next version of the module in which I add a new AdminController. The problem is that the new controller only works if I first uninstall and delete the first version of the module and then install this new version, if I do an update of the module the controllermis not found. Any ideas on why that happens? Do I have to register the new controller as it is done with hooks?

Thanks in advance

Link to comment
Share on other sites

7 hours ago, Prestashop Addict said:

Please can you specify PS, PHP and theme versions

PS 1.7.8.11

PHP 7.4

the theme is not important becausethe controller is not visible, it just does a process and then does a redirect.

this is how i get the controller url

$url = $this->context->link->getAdminLink('ControlMIT') . '&order_id=' . $params['id_order'];


and this is part or the admin controller
 

class ControlMITController extends AdminController
{
    public function initContent()
    {
        $order_id = (int) Tools::getValue('order_id');

        $order = new Order($order_id);
        $url = $this->context->link->getAdminLink('AdminOrders');

        $respuesta = $this->processMIT($order_id);

        if (!is_null($respuesta)) {
	        $this->context->cookie->__set('redirect_message', $respuesta);
        }

        Tools::redirectAdmin($url);
    }

	public function processMIT($order_id)
    {
		//Some process
	}
}

and this is what i get
image.png.53ec216ac9ec0c2a02b72b6a2bcd562d.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...