H
H
haa2021-08-27 14:47:53
1C-Bitrix
haa, 2021-08-27 14:47:53

Why doesn't the action method fire in the OnAdminIBlockElementEdit event?

Hello! Tell me why the Action and Check methods are not called?

GetTabs and ShowTab works.

class CCastomCardsEditFields {

   public function onInit($params) {
        return array(
            "TABSET" => "ADDITIONAL_FIELDS",
            "GetTabs" => array("CCastomCardsEditFields", "tabs"),
            "ShowTab" => array("CCastomCardsEditFields", "showtab"),
            "Action" => array("CCastomCardsEditFields", "action"),
            "Check" => array("CCastomCardsEditFields", "check"),
        );
   }

   public function action($params) {
      print_r("Action");
      return true;
   }

   public function check($params) {
      print_r("Check");
      return true;
   }

   //и другие методы tabs, showtab

}


Call

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
        "main",
        "OnAdminIBlockElementEdit",
        [
            CCastomCardsEditFields::getInstance(),
            'onInit'
        ]
    )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-08-27
@idruweb

Make a static function and call it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question