Questions tagged [admin-controller]
Denotes questions related to Admin Area's Controller. A controller is a part of Model-View-Controller Architecture.
154
questions
0
votes
2answers
44 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 ...
0
votes
0answers
11 views
Magento 2 how to disable or add form key to adminhtml controller?
How can I add a form key to my controller? it's redirecting me to dashboard everything it finishes.
this is my code
use Magento\Backend\App\Action;
use Magento\Framework\App\RequestInterface;
use ...
0
votes
0answers
17 views
Magento 2 Uncaught Error: Call to a member function isLoggedIn() on null
I'm trying to change the order status on Order Detail with a custom controller, but I'm getting this error
Uncaught Error: Call to a member function isLoggedIn() on null
This is my code:
<?php
...
0
votes
0answers
13 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
1answer
22 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
1answer
24 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
1answer
14 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
1answer
17 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
2answers
78 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 ...
1
vote
0answers
36 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(...
0
votes
2answers
127 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
1answer
88 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
0answers
79 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:...
0
votes
5answers
1k 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 ...
0
votes
1answer
36 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 ...
0
votes
1answer
73 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 ($) {...
0
votes
1answer
249 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
1answer
38 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
0answers
53 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
1answer
303 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
1answer
369 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
1answer
217 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
3answers
348 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.
3
votes
1answer
597 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
2answers
198 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
245 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
1answer
244 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
217 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 ...
3
votes
0answers
52 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 ...
4
votes
0answers
40 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
vote
1answer
90 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/...
0
votes
1answer
226 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:
...
0
votes
0answers
35 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
40 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
114 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
1answer
598 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
519 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
533 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
58 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 ...
2
votes
2answers
2k 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\...
3
votes
2answers
472 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
543 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 ...
0
votes
2answers
977 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
2answers
6k 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 ...
4
votes
2answers
2k 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/...
4
votes
1answer
2k 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
1answer
818 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
100 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
1k 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 ...
0
votes
2answers
2k 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()-&...