Skip to content

Commit

Permalink
Move save operation while registering modules after onRegister. Do li…
Browse files Browse the repository at this point in the history
…kewise for onUnregister
  • Loading branch information
austenmc committed Sep 15, 2016
1 parent 2c27f2f commit d92fc5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModuleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function register(LibraryConfiguration $library)
} else {
// TODO: handle error cases here.
$m = new ModuleModel($name);
$m->save($this->g->getEntityManager());

$class = $library->getRootNamespace() . 'Module';
try {
Expand All @@ -74,6 +73,7 @@ public function register(LibraryConfiguration $library)

// Run the module's onRegister handler.
$class::onRegister($this->g, $m);
$m->save($this->g->getEntityManager());
}
}

Expand Down

0 comments on commit d92fc5e

Please sign in to comment.