diff --git a/src/Card.php b/src/Card.php index 00b0544856..50ccbbe1ad 100644 --- a/src/Card.php +++ b/src/Card.php @@ -267,11 +267,11 @@ public function addAction(Model\UserAction $action, $executorClass, $button = nu $vp = VirtualPage::addTo($this)->set(function (View $page) use ($executorClass, $action) { $id = $this->stickyGet($this->name); - $executor = $page->add(new $executorClass()); + $executor = View::addToWithCl($page, [$executorClass]); $action = $action->getActionForEntity($action->getModel()->load($id)); - $executor->setAction($action); + $executor->setAction($action); // @phpstan-ignore-line }); $btn->on('click', new JsModal($action->caption, $vp, [$this->name => (new Jquery())->parents('.atk-card')->data('id')]));