Skip to main content
Share Your Experience: Take the 2024 Developer Survey
17 votes
Accepted

What are the Dispatch/Execute() functions and how do they work?

I'm assuming here you're referring to the Action class dispatch() method and not about the Magento\Framework\Event\ManagerInterface method (that dispatches an event to be used in the observer). In ...
Raphael at Digital Pianism's user avatar
9 votes

Magento 2: How to get controller, module, action and router name?

You can also do : $this->_requestInterface->getFullActionName() To get the full action name
Maxime Huran's user avatar
7 votes
Accepted

How to use ActionInterface insted of Deprecated Action class

The class \Magento\Framework\App\Action\Action is deprecated in the latest version of the Magento. Instead of you should use the GET or POST interface as per your request type \Magento\Framework\App\...
Prince Patel's user avatar
  • 22.7k
6 votes
Accepted

Custom action logging in Magento 2 EE

It is possible to simply add Admin Logging to a module by adding a logging.xml and declare a group and afterwards enable this group in the configuration. Stores > Settings > Configuration > ...
Mr. Lewis's user avatar
  • 1,931
6 votes
Accepted

Magento 2: Admin Action Logging Not able to Found

Admin Actions Logging is a feature of Magento Enterprise Edition: STORES > Configuration > ADVANCED > Admin > Admin Actions Logging
Khoa TruongDinh's user avatar
6 votes

Change block's template in layout XML

To me, the fist syntax is definitely not right, an issue has even been raised regarding it: https://github.com/magento/magento2/issues/3356 The use of the setTemplate action method is still right for ...
Raphael at Digital Pianism's user avatar
6 votes
Accepted

Edit Action column is not showing in admin grid in magento 2

Please replace this node. I change from id to entity_id. <actionsColumn name="actions" class="AdminGrid\Grid\Ui\Component\Listing\Grid\Column\Action"> <argument name="data" xsi:...
Eugene Kapelko's user avatar
6 votes
Accepted

Magento2 :How To Use Form Key In Frontend Grid Using Ui Component

Please add following code in your controller : protected $request; protected $formKey; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\Data\Form\...
Chirag Gondaliya's user avatar
5 votes
Accepted

Custom module dynamic action controller

you will need a custom router. Add this inside the global tag in config.xml <events> <controller_front_init_routers> <observers> <market> ...
Marius's user avatar
  • 198k
5 votes
Accepted

How are pages such as customer account login protected?

From what I understood, there's basically two ways Magento does this. The first one is via a plugin: Magento\Customer\Controller\Plugin\Account declared in etc/frontend/di.xml : <type name="...
Raphael at Digital Pianism's user avatar
4 votes

Magento 2: Admin Action Logging Not able to Found

Admin action logging feature is only available for Enterprise Edition. If you wish to use this feature in community version then you can explore couple of paid plugins - https://marketplace.magento....
Ronak Singhavi's user avatar
4 votes
Accepted

Magento 2 admin menu action result Invalid security or form key. Please refresh the page. on click

add code in menu.xml <add id="Testing_Basic::item" title="Manage Items" module="Testing_Basic" sortOrder="10" parent="Testing_Basic::menu" action="create/webpage/...
Ranjeet Kumar's user avatar
3 votes
Accepted

Magento prevent initialization of user session at ActionController

After digging deeper into the Magento code I realized the pre_dispatch()-method supports additional flags. Controller won't start a user session public function preDispatch() { $this->...
pbaldauf's user avatar
  • 237
3 votes
Accepted

Send Email and Save Data to database table with custom form

you can send custom email with below code. $mail = Mage::getModel('core/email'); $body = '<p>Hello,</p> <p>A New CLient Review Is Received:</p> <p><b&...
Qaisar Satti's user avatar
  • 32.5k
3 votes

Is the column `Action` very important?

$this->addColumn('action', array(...)) adds the action column in the grid. Yes if you wish to remove you can. You can remove from css, commenting or by removing the whole code.It will not break ...
Priyank's user avatar
  • 7,702
3 votes
Accepted

Is the column `Action` very important?

Generally, the Action column is not important as long as it is doing the same as clicking on the row. Action tab is added when there are more operations to perform on a row, like in the CMS Pages grid ...
Piyush's user avatar
  • 5,904
3 votes
Accepted

controller action name of module is displaying in frontend

You need to remove echo from your observer code. public function onControllerActionPredispatch($observer) { Mage::log($observer->getEvent()->getControllerAction()->getFullActionName(), ...
Jaimin Sutariya's user avatar
3 votes

Magento 2: Admin Action Logging Not able to Found

To add to Khoa's answer and where to find reporting data itself: Stores -> Configuration -> Advanced -> Admin (to enable/disable available logging) System -> (under) Action Log -> Report (to view ...
dchayka's user avatar
  • 500
3 votes
Accepted

Magento 2: get controller, module, action name in template file?

If your template extends \Magento\Framework\View\Element\Template then you you have access to request via $this->_request
Petar Dzhambazov's user avatar
3 votes

Magento2 : admin grid action column position deviation

Truncate ui_bookmark Table From Database TRUNCATE TABLE ui_bookmark; Do clean cache
Ronak Rathod's user avatar
  • 6,332
3 votes

Issue with edit Option in Action column admin grid

Please truncate ui_bookmark table from the database and run the following commands into the cmd. php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento indexer:...
Hardik Makwana's user avatar
3 votes

Getting information about a request using HttpGetActionInterface

<?php ... use Magento\Framework\App\RequestInterface; class ... { protected $request; public function __construct( ... RequestInterface $request ) { ....
Nilesh Dubey's user avatar
  • 1,087
2 votes

Custom module dynamic action controller

I guess you can pass a parameter to your main action method and then use a switch to forward to another action of the same controller, for example: public function myAction() { $param = $this->...
Raphael at Digital Pianism's user avatar
2 votes

Why can't I inject the ProductRepositoryInterface in Magento 2?

What worked for me is running the compile command. /var/www/magento2-root$ php bin/magento setup:di:compile
dvarney's user avatar
  • 21
2 votes

Change block's template in layout XML

You have to set new template file using default.xml file, Set below xml inside your theme default.xml file and remove cache and see changes. Add new.phtml file inside app/code/Vendor/Module/view/...
Rakesh Jesadiya's user avatar
2 votes

Form Submission not loading correct url

Your module url work like routename/controllername/actionname In your case route is helloworld Controllername is IndexController so name is index Action name of IndexController.php file where you ...
Prashant Valanda's user avatar
2 votes
Accepted

Form Submission not loading correct url

it depend on what is your <frontName>modulename</frontName> try that with complete url method="post" action="<?php echo Mage::getUrl('helloworld/index/index') ?>" you are using ...
Qaisar Satti's user avatar
  • 32.5k
2 votes
Accepted

Admin custom page form action not working

Change your form action to <?php echo Mage::helper("adminhtml")->getUrl("your_adminhtml_router/custom/insertsilverrate") ?> you can get your adminhtml router from etc/config.xml file
Piyush's user avatar
  • 5,904
2 votes
Accepted

Mage2 - Custom Grid Action 404 error

Try replacing <item name="url" xsi:type="string">*/*/newAction</item> with <item name="url" xsi:type="string">*/*/new</item> and make sure that the file Altravista/Blog/...
Marius's user avatar
  • 198k

Only top scored, non community-wiki answers of a minimum length are eligible