diff --git a/Theme.php b/Theme.php index b2634046b..f2c8a2e93 100755 --- a/Theme.php +++ b/Theme.php @@ -537,12 +537,14 @@ function _init() { $app->hook('template(panel.index.content):before', function() use ($app){ $app->view->enqueueScript('app', 'menu_names', 'js/menu_names.js'); }); + /** * Hook para corrigir redirect para form de importação */ - $app->hook('entity(Opportunity.importFields:after', function() use($app) { - $entity = $this->controller->requestedEntity; - $app->redirect($entity->editUrl.'#tab=form-config'); + $app->hook('entity(Opportunity.importFields:after', function () use ($app) { + $opportunity = $app->repo("Opportunity")->find($this->id); + + $app->redirect($opportunity->editUrl . '#tab=form-config'); }); /**