News:

Looking for documentation? Take a look on our wiki

Main Menu

Custom controller doesn't load anymore

Started by lica, April 27, 2020, 16:34:45 PM

Previous topic - Next topic

lica

Hi,
I have a plugin vmextended wich defines a custom controller and view. The main method is

public function onVmAdminController ($controller) {
        if ($controller = $this->getName()) {
            VmModel::addIncludePath($this->_path . DS . 'models');
            VmTable::addIncludePath($this->_path . DS . 'tables');
            require_once($this->_path.DS.'models'.DS.'XXXXX.php');
            require_once($this->_path.DS.'controllers'.DS.'XXXXX.php');
            return true;
        }
  }


The controller is not loaded any more since this https://dev.virtuemart.net/projects/virtuemart/repository/revisions/10304/entry/trunk/virtuemart/administrator/components/com_virtuemart/virtuemart.php#L50 check sets $exe variable to false so in the next check the controller is not loaded anymore

This behavior was added with: https://dev.virtuemart.net/projects/virtuemart/repository/revisions/9074/diff/trunk/virtuemart/administrator/components/com_virtuemart/virtuemart.php
Before this everything was working fine.

After I import my controller I use `return false` it works fine but it seams logically wrong.
I this a bug or how am I supposed to load my custom controllers?

VirtueMart 3.6.10 10211

Studio 42

What is wrong?
If you return true, it mean that your controller is loaded correctly and VM do not need to check and load itself the controller 

IN my case i load internally the controller, so i dont want tha VM load it again.