Questions tagged [admin-controller]

Denotes questions related to Admin Area's Controller. A controller is a part of Model-View-Controller Architecture.

Filter by
Sorted by
Tagged with
0 votes
1 answer
13 views

Admin panel sidebar links doesn't work in production mode

I have an issue while i switch my magento website in production mode, The website is finally ready to be set but now i face a problem after i've installed many modules and packages, i don't know why ...
  • 1
0 votes
1 answer
19 views

Observer redirect to admin controller not working in https

here is the code: events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
  • 2,151
0 votes
1 answer
24 views

I am redirecting in dashboard when perform save product in magento2.4.5

I have increased max_input_vars size very big still i am getting 'Invalid Form Key. Please refresh the page.' , when product save in backend. Even i am doing save any thing in backend i am redirecting ...
  • 3,279
0 votes
1 answer
22 views

1 exception(s): Exception #0 (ReflectionException): Class "MyVendor\SubOrder\Controller\Adminhtml\Order\View\Interceptor" does not exist

I am creating a suborder view page in BackOffice that retrieves data from the customized table. However, I received an error on above topic when I click the view button in my customized grid. Did I ...
0 votes
1 answer
29 views

How to redirect to the form with entered data if a form content have any error in magento 2 admin custom form?

I have a custom admin form, After click save button i am checking some unique url in my save controller. If the url is not unique, i want to pass an error message and redirected to the form with filed ...
  • 2,651
0 votes
0 answers
184 views

magento 2.4.3 Request validation failed for action "\Controller\Adminhtml\Import\Save\

4.3 admin custom controller redirecting to dashboard <form enctype="multipart/form-data" method="post" action="<?php echo $block->getFormAction(); ?>" id=&...
0 votes
0 answers
117 views

How we can call multiple blocks in a single controller?

Is there a way to call multiple blocks in a single controller in Magento 2? The below code only populate the single grid but I want it to return two blocks. public function execute() { /* @...
  • 205
0 votes
1 answer
103 views

Capture payment online after create quote programmatically

I need programmatically to capture payment online using the PayPal Payflowpro method and credit card details. Also, create an order number and invoice after creating a quote then setting quote_id in ...
  • 51
0 votes
1 answer
58 views

Custom link in order grid not able to access custom controller but forward to order details page

I've successfully create a column in order grid page. The sales_order_grid.xml <?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="http://www.w3.org/2001/...
  • 2,151
0 votes
1 answer
63 views

Get Controller of each request

What I want just to print out name of each controller called at a specific request? So How can I do that any help thanks in advance?
1 vote
0 answers
99 views

How to link a custom button to a controller file in magento form

So I have a custom module where I have custom form and custom product grid section. So I have created some custom button on both pages through UI components. Now I want to link these buttons with a ...
0 votes
1 answer
24 views

Magento 1: Can't override Enterprise/GiftCardAccount/controllers/Adminhtml/GiftcardaccountController.php

I can't override the controller inside of the Enterprise/GiftCardAccount/controllers/Adminhtml/ folder <config> ... <admin> <routers> <adminhtml> <...
0 votes
1 answer
712 views

Magento 2 Add Button in Edit Product page and land back there after POST request

So, as the title says, I want to add an Admin button in the Edit Product Admin page. That button, when pressed, will call the respective controller of a URL, sending along the product id, the ...
  • 117
0 votes
0 answers
187 views

Magento 2 Admin Menu buttons (UiComponent buttons) behaviour

Question What do I need to setup a Button's behaviour, or is there CRUD built-in Magento 2 behaviour when I do not specify a Controller? This is The tutorial article I am following. I found the ...
0 votes
1 answer
55 views

Magento 2 custom dashboard Page

I want to show a completely custom dashboard. I have a controller for that. I just want to show this page when Admin login. I don't want to show the default Magento dashboard controller I want my ...
  • 816
0 votes
1 answer
108 views

Magento 2 : Acl admin controller

I can see below code in file use Magento\Backend\App\Action; /** * Abstract assignment controller */ abstract class Assignment extends Action { /** * Authorization level of a basic admin ...
  • 467
0 votes
2 answers
267 views

How can i override abstract class protected function

I want to override abstract class Magento\Sales\Controller\Adminhtml\Order\Create of the below method protected function _processActionData($action = null){ } I have tried using preference but it ...
  • 6,016
0 votes
0 answers
261 views

Magento 2 how to redirect backend controller to previous page?

I'm trying to redirect a controller that is executed in Order Detail. If I end the controller returning redirect like this, it throws an error: return $resultRedirect; If I end the controller with ...
0 votes
1 answer
76 views

check admin loggedIn on frontend magento 2

i have tried through this method public function isAdmin() { $this->_coreSession->start(); echo $this->_coreSession->getMessage(); echo 'session test4'; ...
0 votes
1 answer
44 views

how to check admin loggedin or not on frontend magento 2 [duplicate]

how to check admin loggedIn or not on front-end magento 2 .I have tried this class BackendAuthUserLoginSuccess implements ObserverInterface { const DEFAULT_SESSION_NAME_OF_FRONTEND = 'PHPSESSID'; ...
0 votes
1 answer
220 views

how to get magento admin users from magento 1.9

I want to get magento admin users and assign them a mobile number, from each particular agent panel, agent can able make a call from that number.
0 votes
1 answer
66 views

Magento 2 admin controller is not working

Here am added a admin controller, here is my code etc/adminhtml/routes.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0 votes
2 answers
1k views

save admin form and redirect back url in magento 2.3

I have create admin sales grid. All is working fine. And i have added one link in order view page. This link click redirect custom admin form. And Finally i want to save custom admin form. And ...
  • 3,550
1 vote
0 answers
143 views

Magento 2 add text input to massaction from dropdown

In magento 1, if I wanted to add a text input to send a custom value with my massaction to my controller, I would do something like: $this->getMassactionBlock()->addItem('add_ship_method', array(...
  • 368
0 votes
2 answers
1k views

Type Error occurred when creating object

I am having the massaction "delete" in the ui_component and it is then process by a controller MassDelete in my adminhtml folder. like this: <?php namespace Apriljune\Testimonial\...
1 vote
1 answer
840 views

How To Add Fixed Filter In Custom Admin Block Grid in Magento 2?

Here is my custom grid i wan to show only those data that status is paid but now the data present with paid and unpaid both . how can i set default filter to these custom block grid... here is my ...
1 vote
0 answers
400 views

Magento 2 override admin Controller Address Save.php

How to override admin controller address save.php I am using this code - di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
  • 1,185
2 votes
5 answers
5k views

Custom Module Controller: Invalid security or form key. Please refresh the page

I have a custom module with an admin controller, but when I try to access from the administration page I get the following error: My controller is in Controller/Adminhtml/Login/Index.php class Index ...
  • 539
0 votes
1 answer
68 views

Find backoffice controller

I have a javascript call to this url : https://mysite/admin/admin/export/export/key/b7c4bdb5a1b9f5147f498741adc99/entity/catalog_product/file_format/csv From this url how can I find where is located ...
  • 3
1 vote
1 answer
348 views

Magento 2 admin Ajax call failed bad request

I'm using custom js in Product Add/Edit page of magento 2 admin. I need to make a ajax call when the product save button clicked. I used the below code. require(['jquery', 'domReady!'], function ($) {...
  • 816
1 vote
2 answers
806 views

Magento 2 Admin controller is not working 404 error

I don't why my admin controller is not working, I have checked it and everything seems to be ok. This is my code: etc/adminhtml/routes.xml <?xml version="1.0"?> <config xmlns:xsi="http://...
0 votes
1 answer
118 views

How to collect customer data who has added the product to wishlist?

I have a requirement that is collect customers data like wishlist, address and send them to another server using SFTP. These all should be programmatically. Could anyone please guide me on this? ...
0 votes
0 answers
241 views

My ajax request isn't working properly in phtml

vendor\module_name\view\adminhtml\templates\tab\customer_view.phtml <?php $buttonTitle = __('Invalidate Quotes');?> <div class="fieldset-wrapper customer-information"> <div ...
1 vote
1 answer
606 views

Magento 2: Abstract Controller class is not being override

I am trying to override an abstract class vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php using di.xml but it is not working. I need to do some changes in method protected function ...
0 votes
1 answer
1k views

How to override product attribute Save.php controller using modulein magento 2?

I am trying to create a module in which I am facing some issues to override Save.php Controller as well as save that data in the new table. here is my updated di.xml code, but now after click on save,...
0 votes
1 answer
547 views

Magento 2 Custom Admin module 404 Not Found

I have been struggling with this error all day, I have tried all the solutions on Internet, but it keeps showing 404 Error when I click the link on my custom menu. Here is my code /app/code/Vendor/...
2 votes
3 answers
704 views

Magento 2: How to get current category id in admin controller

I have made a custom button on category edit page in admin. The button redirects to custom admin controller. I need to fetch the current category id in the controller.
  • 580
3 votes
1 answer
1k views

How can I make my controller return JSON back to my template PHTML

Controller: <?php namespace MyCompany\ExampleAdminNewPage\Controller\Adminhtml\Product; use Magento\Framework\App\Action\Context; use Magento\Framework\Controller\ResultFactory; class Product ...
1 vote
2 answers
604 views

How to create controller without creating menu in Adminhtml Magento 2

I have referred below Article to display button in my Configuration page. https://magecomp.com/blog/add-a-button-in-magento-2-stores-configuration-with-custom-action/ In file app\code\Vendor\...
  • 805
3 votes
1 answer
624 views

Magento 2 - How to pass parameter from menu.xml

Is there any way to pass a parameter to controller from menu.xml file? Actual URL : http://127.0.0.1/mg231/admin/vendor/module/index/key/...
0 votes
1 answer
353 views

Can't access admin after update Magento 2.3.1

I recently updated my Magento 2.3.0 to 2.3.1, and my site works, but I when I try to go to my admin url I get a 504 error. I have tried clearing my cache, and I tried following advice to clear the ...
1 vote
1 answer
573 views

Can we redirect controller to another controller in another custom function rather execute function?

Can we redirect controller to another controller in such a way that previous controller continue its working in its execute method and next controller works render the layout at a same time? and after ...
  • 1,411
3 votes
0 answers
54 views

Extension works fine on local system but on live instance it gives me error

Can someone please give me some detail about my issue. I am duplicating categories along with the product on my local system it works fine although it takes little more time but works fine on my live ...
  • 1,411
4 votes
0 answers
41 views

System stuck on a controller on live instance does not return any thing nor redirect

I am duplicating the category tree with products works fine on my system while checking on live instance. scenario Duplicate category and subcategory but not products works fine. Duplicate category ...
  • 1,411
1 vote
1 answer
125 views

Magento 1.9 custom module for managing admin users in different role

Am working on a custom module for managing admin users in a custom role. Just finished the grid section. I need to edit the listed users, also a add form. I just tried by overriding the 'Mage/...
  • 159
0 votes
1 answer
353 views

Magento2 Admin UI Component: On fileUploader ajax completion in ui component, how can I reload the page it is on?

I have a grid that just shows a collection of a specific table. below is a file upload component that I want to use for CSV upload, that will replace all old collection. Image reference is below: ...
  • 211
0 votes
0 answers
37 views

Magento 1.9 admin menu is going to 404!

I am using custom module to getting tax report. It is working fine on demo site. Below is the etc/config.xml: <?xml version="1.0" ?> <config> <modules> <DS_News> ...
  • 2,025
0 votes
0 answers
50 views

Custom action won't work?

My Customized controller seems not work. Added new method which suppose to update some values in table, here is my method: public function reorderAction() { Mage::log('=> test',true,'...
  • 867
2 votes
2 answers
218 views

Grid with multiple Resource Models

I'm trying to use one grid for multiple ResourceModels, so far I've got one grid working fine. I can load the grid up fine using http:{}/admin/grid/grid/ However when i create a new route to load ...
1 vote
1 answer
829 views

call block from controller via ajax

I call controller function from phtml via ajax, it calls controller function Now i am trying to call block function in controller it is not working Controller code public function __construct( ...