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
17
votes
6answers
12k views

Magento 2 Custom Admin Action Redirected to Dashboard

I am taking the Magento 2 fundamentals development course and the Admin Router / Controller exercise seems out of date. The router does work, but the controller does not, it always just re-routes to ...
0
votes
2answers
742 views

Fatal error: Uncaught Error: Call to undefined method getDirectoryRead()

I have a controller that works and does what i need it to do if i manually add a path like: $mediaImages = '/magento/pub/media/images/'; But i cant get the DirectoryList injection to work, it returns ...
2
votes
3answers
64 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.
0
votes
2answers
36 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\...
3
votes
1answer
43 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 ...
4
votes
1answer
634 views

Magento 2 Blank Layout Page

I tried to create a new tab in customer edit backend. First i create the app/code/Namespace/Point/view/adminhtml/layout/customer_index_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
2
votes
2answers
1k views

Error While Compiling Magento 2 admin page module

I'm getting error while compiling the Magento 2 admin module. The error which I'm getting is Fatal error: Class Tutorial\SimpleNews\Controller\Adminhtml\News contains 1 abstract method and must ...
1
vote
1answer
18 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/...
1
vote
4answers
757 views

Can't access magento 2.1.3 admin getting some error

While trying to access the admin panel i got following error. This was shown up from yesterday up to that time i don't have any issue 1 exception(s): Exception #0 (Magento\Framework\Exception\...
3
votes
0answers
51 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 ...
3
votes
4answers
4k views

How to send ADMIN AJAX request?

I need to retrieve some information from my custom admin controller using AJAX. But when AJAX is used I get current page's entire HTML ! I simply want to get some JSON data from my custom ...
0
votes
2answers
1k views

How to call adminhtml controller?

I want to call my custom adminhtml controller on form action. see my config file admin please and how to call controller. <?xml version="1.0"?> <config> <modules> <...
1
vote
0answers
41 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/...
5
votes
4answers
3k views

Magento 2 - Backend custom module 404 error

I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu ...
3
votes
1answer
1k views

Ajax not working in Magento 2 admin

I'm using ajax in Magento 2 admin. But it not working. My controller: class CustomAjax extends \Magento\Backend\App\Action{ protected $resultJsonFactory; public function __construct( \Magento\...
1
vote
1answer
696 views

Magento 2.2.5: Overriding Admin Controller sales/order

I need to override Admin sales/order/index controller, but still getting 404. Below the Steps I take to override - Created My Custom Module app/code/A2bizz/Order/registration.php <?php \Magento\...
0
votes
1answer
48 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
1answer
52 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 ...
0
votes
0answers
17 views

Magento 2.3 Admin product Detail show as tabs

Is there a extension that make the Admin Product detail showing in tabs instead of accordion? Liz
0
votes
0answers
49 views

How to add massaction in product grid in magento 1

What is the easiest way to add add mass action to product grid using only observer and controller(no block). I would like to see a simple example because it is the first time I create it.
4
votes
0answers
38 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 ...
0
votes
2answers
2k views

Admin controller throws 404 page not found for my custom extension

I am creating a custom extension with Magento 1.9.0.1 but got stuck in admin controller as my admin controller throws 404 page not found error. Any help would be appreciated. Below is my code : ...
0
votes
1answer
107 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: ...
2
votes
2answers
426 views

Fatal error: Uncaught Error: Call to a member function isLoggedIn() on null in

di.xml <preference for="Magento\Catalog\Controller\Adminhtml\Category\Save" type="Modulename\Complexgrd\Controller\Adminhtml\Category\Save" /> Save.php <?php namespace Modulename\...
1
vote
5answers
1k views

“Visible Section not found” at backend login in Magento 2

When I switch the store to a specific domain https:// example.com (secure & unsecure), I get the error "Visible Section not found" when trying to log into the backend. The funny thing: as soon ...
0
votes
0answers
28 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> ...
0
votes
0answers
30 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,'...
2
votes
2answers
67 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 ...
0
votes
0answers
35 views

Show Model PoPuP after executing massAction in Magento 2?

I have a custom massAction after executing the function I need to show the model popup. In my case, I am sending the multiple requests to web service and storing the array of messages if I use below ...
1
vote
3answers
1k views

Magento2 : admin controller not working

i created a button in the order/view page in magento2 backend, and would like to call a controller when button in clicked. In my module, I added : etc/adminhtml/routes.xml <?xml version="1.0" ?&...
1
vote
1answer
278 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( ...
0
votes
2answers
128 views

Registry not working in magento 2

I need to call the controller function from block . in magento 2 i use the registry. In my block i wrote public function __construct( Template\Context $context, \Magento\Catalog\...
0
votes
1answer
236 views

Magento 2 Programmatically set theme for specific stores

Programmatically How can set a theme for specific stores in Magento 2.1
0
votes
1answer
123 views

override Magento\Sales\Controller\Adminhtml\Order\Create\Save.php file

How to override Magento\Sales\Controller\Adminhtml\Order\Create\Save.php the file can you please help me out?
0
votes
1answer
50 views

Magento 2 Custom admin module not working

I have created my custom module for order export and this is working fine in my magento 2.5 and magento 2.6 but this OR any other module is installed in my magento 2.2 it will not show in admin and ...
0
votes
1answer
188 views

How to get selected Order Ids in block from Sales Order Grid? Magento2

I want to generate PDF of selected orders, Rest of the functionality is complete just wanted to get selected Ids from sales order grid. For now I am getting full list of Orders on clicking my custom ...
3
votes
2answers
114 views

Controller function not working after overwrite afterExecute : M2

Di.xml <type name="Magento\Catalog\Controller\Adminhtml\Category\Save"> <plugin name="mymodule" type="Module\Name\Plugin\Controller\Adminhtml\Category\Save"/> </type> ...
0
votes
1answer
381 views

How to create custom pdf on controller action using TCPDF in magento 2

I have added TCPDF as follows: Downloaded TCPDF library from https://github.com/tecnickcom/tcpdf and place at magento2.0/lib/internal/TCPDF Renamed tcpdf.php to TCPDF.php Opened TCPDF.php and change ...
1
vote
1answer
2k views

magento 2 redirect url with parameters from controller

I am trying to redirect to a different controller from one controller . I also want to set an Url parameter along with the redirect. But this is throwing me an error Uncaught Error: Call to ...
2
votes
2answers
1k views

Dynamic hide form fields for different action

I have 2 action in IndexController: newAction() and editAction(). Both those actions will use a same form (about 5 inputs: First Name, Last Name, Email, Status, Example) But in the newAction(), I ...
4
votes
2answers
429 views

Magento 225 :Notice: Array to string conversion

When I try to create a new record in my custom module I get the below mentioned error Something went wrong while saving the item.Notice: Array to string conversion in /opt/lampp/htdocs/...
0
votes
0answers
19 views

2 Different keys are being genereated, Admin Grid action column-> edit link and page created after clicking save and continue butotton

I have created a Module, I created an admin grid and crud operations. All are working fine when I disabled secret key form store configuration. In show secret key in url my Edit action and Delete ...
2
votes
1answer
230 views

Magento2 make simple afterSave action plugin of custom module

I am trying to create afterSave plugin for my admin form save action controller of my custom module. The purpose of this is to save some data into second table once all data completely save in first ...
0
votes
2answers
62 views

How to pass value from controller to /resourceModel/Collection.php class

There are two table t1 and t2 t1 id, name 1, abc 2, pqr t2 id, t1_id, phone 1 , 1 , 7894561230 2, 1 , 7894645125 3, 2, 7445582145 I am having two grids, grid 1 showing the first table. Now if i ...
2
votes
1answer
678 views

Magento 2 | Add Admin Configuration Button Action

I need to call a method from an admin configuration button. This is my simple custom module. The button appear on admin but notthing appen on click. No log is write. I cannot understand what I am ...
4
votes
2answers
943 views

I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error? [duplicate]

Recoverable Error: Argument 1 passed to Webkul\Grid\Controller\Adminhtml\Grid\Index::__construct() must be an instance of Magento\Backend\App\Action\Context, instance of Magento\Framework\...
0
votes
2answers
685 views

Retrieve Values passed in Ajax Magento 1.9

After making the ajax call, i try to recover the values, but returns null this is function inside controller public function checkAction() { # Retrieve value //$checkbox = Mage::app()-&...
1
vote
1answer
34 views

Can I make separate controller for AJAX actions? (Magento 1.x)

I have my custom module and everything works fine, but I would like to create separately controller for AJAX actions (AjaxController). Currently I Have only IndexController. Everytime I get: {"error":...
2
votes
0answers
296 views

Magento 2 adminhtml layout.xml not loading

The Controller File works fine, die('dasdsa') works. But i am not getting any result on the Backend Page except the Title Change within the Controller. I Guess it's just something simple :X Classy/...
3
votes
1answer
912 views

Magento 2: How to submit custom html content from ui_form to controller?

I am developing a module using ui_form. I have developed ui_form and on submit it post all fields except custom html fields. For example: <container name="pl_labelposition" > <...