Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module dependency > update module case check #1440

Open
Marc-pi opened this issue Dec 27, 2016 · 0 comments
Open

Module dependency > update module case check #1440

Marc-pi opened this issue Dec 27, 2016 · 0 comments

Comments

@Marc-pi
Copy link
Member

Marc-pi commented Dec 27, 2016

@taiwen

In mymodule/config/module.php, we can set module dependency through an array

// Module dependency: list of module directory names, optional
    'dependency'    => array(
    ),

We checked the code :

  • at first install, it displays a warning and ask to install the dependant module before (you cannot install instead)
  • But seems some code was done to manage also Update, but seems it does not work
    • we were not able to reach the IF condition during a module upgrade
      if ($this->event->getParam('upgrade'))

Fichier Pi/Application/Installer/Action/Update.php :

protected function attachDefaultListeners()
   {
       $events = $this->events;      
       if ($this->event->getParam('upgrade')) {
           $events->attach('update.post', array($this, 'removeDependency'));
           $events->attach('update.post', array($this, 'createDependency'));
       }

       return $this;
   }

Is there something we missed to use this ?

Or is such this change the solution?

protected function attachDefaultListeners()
   {
       $events = $this->events;
       $events->attach('update.pre', array($this, 'checkIndependent'));
       
       if ($this->event->getParam('upgrade')) {
           $events->attach('update.post', array($this, 'removeDependency'));
           $events->attach('update.post', array($this, 'createDependency'));
       }

       return $this;
   }
@Marc-pi Marc-pi changed the title Module dependency > update check Module dependency > update module case check Dec 27, 2016
@voltan voltan added this to the Pi version 2.7 milestone Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants