How to pass custom parameters to parent construct?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?Magento 2 Custom Module New Controller IssueHow to override core class which is already overrided by other custom module in Magento 2main.CRITICAL: Plugin class doesn't exist__construct() argument error when overriding 2 custom modules from same core moduleMagento 2 admin form controller errorMagento 2.2.0 - __construct() must be an instance of MagentoFrameworkViewResultPageFactory,Magento 2.3 Can't view module's front end page output?Unable to Serialize Value Magento 2.2.6Unable to serialize value problem with Magento 2.2.6

How can I determine if the org that I'm currently connected to is a scratch org?

Cursor Replacement for Newbies

How badly should I try to prevent a user from XSSing themselves?

Expand and Contract

Size of subfigure fitting its content (tikzpicture)

Intersection Puzzle

Should I tell management that I intend to leave due to bad software development practices?

What exploit Are these user agents trying to use?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Personal Teleportation: From Rags to Riches

Watching something be piped to a file live with tail

What is a romance in Latin?

Can I run a new neutral wire to repair a broken circuit?

Short story with a alien planet, government officials must wear exploding medallions

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

How do conventional missiles fly?

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

How to Recreate this in LaTeX? (Unsure What the Notation is Called)

Avoiding the "not like other girls" trope?

Is there a hemisphere-neutral way of specifying a season?

Is "remove commented out code" correct English?



How to pass custom parameters to parent construct?


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?Magento 2 Custom Module New Controller IssueHow to override core class which is already overrided by other custom module in Magento 2main.CRITICAL: Plugin class doesn't exist__construct() argument error when overriding 2 custom modules from same core moduleMagento 2 admin form controller errorMagento 2.2.0 - __construct() must be an instance of MagentoFrameworkViewResultPageFactory,Magento 2.3 Can't view module's front end page output?Unable to Serialize Value Magento 2.2.6Unable to serialize value problem with Magento 2.2.6













0















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
























  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago















0















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
























  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago













0












0








0








I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);











share|improve this question
















I have extended MagentoSalesControllerAdminhtmlOrder to Custom class like below,but not able pass one more parameter($httpClientFactory) to this construct level.



How to pass custom parameters($httpClientFactory) to parent construct?



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
**MagentoFrameworkHTTPZendClientFactory $httpClientFactory**
)
$this->layoutFactory = $layoutFactory;
**$this->_httpClientFactory = $httpClientFactory;**
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);








magento2 construct






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 20 hours ago









ABHISHEK TRIPATHI

2,0611728




2,0611728










asked 21 hours ago









Vamsy KrishnaVamsy Krishna

111




111












  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago

















  • you have to define _httpClientFactory before your constructor

    – magefms
    21 hours ago











  • like protected $_httpClientFactory

    – magefms
    21 hours ago











  • I have defined also like protected $_httpClientFactory , but it is not working

    – Vamsy Krishna
    20 hours ago











  • what error did you get?

    – magefms
    20 hours ago











  • why do you need this _httpClientFactory?

    – magefms
    20 hours ago
















you have to define _httpClientFactory before your constructor

– magefms
21 hours ago





you have to define _httpClientFactory before your constructor

– magefms
21 hours ago













like protected $_httpClientFactory

– magefms
21 hours ago





like protected $_httpClientFactory

– magefms
21 hours ago













I have defined also like protected $_httpClientFactory , but it is not working

– Vamsy Krishna
20 hours ago





I have defined also like protected $_httpClientFactory , but it is not working

– Vamsy Krishna
20 hours ago













what error did you get?

– magefms
20 hours ago





what error did you get?

– magefms
20 hours ago













why do you need this _httpClientFactory?

– magefms
20 hours ago





why do you need this _httpClientFactory?

– magefms
20 hours ago










2 Answers
2






active

oldest

votes


















0














You can try like this



<?php
class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @var MagentoFrameworkHTTPZendClientFactory
*/
protected $_httpClientFactory;

/**
* @var MagentoFrameworkObjectManagerInterface
*/
protected $_objectManager;

/**
* Custom constructor.
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
* @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
* @param MagentoFrameworkObjectManagerInterface $objectmanager
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
MagentoFrameworkObjectManagerInterface $objectmanager
)
$this->layoutFactory = $layoutFactory;
$this->_httpClientFactory = $httpClientFactory;
$this->_objectManager = $objectmanager;
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);


public function execute()

//you execute logic here







share|improve this answer























  • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago











  • not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago


















0














I think you are forgetting to add use statement for certain classes like




ActionContext $context,



OrderManagementInterface $orderManagement,



OrderRepositoryInterface $orderRepository




etc. Also, I'm not able to see any namespace for your class.
Your file should look like below.



<?php

namespace [Vendors][Module]ControllerAdminhtml;

use MagentoBackendAppAction;
use MagentoSalesApiOrderManagementInterface;
use MagentoSalesApiOrderRepositoryInterface;
use MagentoFrameworkExceptionNoSuchEntityException;
use MagentoFrameworkExceptionInputException;
use PsrLogLoggerInterface;

class Custom extends MagentoSalesControllerAdminhtmlOrder

/**
* @var MagentoFrameworkViewLayoutFactory
*/
protected $layoutFactory;

/**
* @param ActionContext $context
* @param MagentoFrameworkRegistry $coreRegistry
* @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
* @param MagentoFrameworkTranslateInlineInterface $translateInline
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
* @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
* @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
* @param OrderManagementInterface $orderManagement
* @param OrderRepositoryInterface $orderRepository
* @param LoggerInterface $logger
* @param MagentoFrameworkViewLayoutFactory $layoutFactory
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function __construct(
ActionContext $context,
MagentoFrameworkRegistry $coreRegistry,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkTranslateInlineInterface $translateInline,
MagentoFrameworkViewResultPageFactory $resultPageFactory,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
MagentoFrameworkControllerResultRawFactory $resultRawFactory,
OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
MagentoFrameworkViewLayoutFactory $layoutFactory,
MagentoFrameworkHTTPZendClientFactory $httpClientFactory
)
$this->layoutFactory = $layoutFactory;
$this->_httpClientFactory = $httpClientFactory;
parent::__construct(
$context,
$coreRegistry,
$fileFactory,
$translateInline,
$resultPageFactory,
$resultJsonFactory,
$resultLayoutFactory,
$resultRawFactory,
$orderManagement,
$orderRepository,
$logger
);




Try this. After making changes clear generated folder and flush cache. It may work for you.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268455%2fhow-to-pass-custom-parameters-to-parent-construct%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer























    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago















    0














    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer























    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago













    0












    0








    0







    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here







    share|improve this answer













    You can try like this



    <?php
    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @var MagentoFrameworkHTTPZendClientFactory
    */
    protected $_httpClientFactory;

    /**
    * @var MagentoFrameworkObjectManagerInterface
    */
    protected $_objectManager;

    /**
    * Custom constructor.
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    * @param MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    * @param MagentoFrameworkObjectManagerInterface $objectmanager
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory,
    MagentoFrameworkObjectManagerInterface $objectmanager
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    $this->_objectManager = $objectmanager;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );


    public function execute()

    //you execute logic here








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 17 hours ago









    magefmsmagefms

    2,3052426




    2,3052426












    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago

















    • getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

      – Vamsy Krishna
      16 hours ago











    • not able to add/ override constructor properly

      – Vamsy Krishna
      15 hours ago
















    getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago





    getting error like A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

    – Vamsy Krishna
    16 hours ago













    not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago





    not able to add/ override constructor properly

    – Vamsy Krishna
    15 hours ago













    0














    I think you are forgetting to add use statement for certain classes like




    ActionContext $context,



    OrderManagementInterface $orderManagement,



    OrderRepositoryInterface $orderRepository




    etc. Also, I'm not able to see any namespace for your class.
    Your file should look like below.



    <?php

    namespace [Vendors][Module]ControllerAdminhtml;

    use MagentoBackendAppAction;
    use MagentoSalesApiOrderManagementInterface;
    use MagentoSalesApiOrderRepositoryInterface;
    use MagentoFrameworkExceptionNoSuchEntityException;
    use MagentoFrameworkExceptionInputException;
    use PsrLogLoggerInterface;

    class Custom extends MagentoSalesControllerAdminhtmlOrder

    /**
    * @var MagentoFrameworkViewLayoutFactory
    */
    protected $layoutFactory;

    /**
    * @param ActionContext $context
    * @param MagentoFrameworkRegistry $coreRegistry
    * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
    * @param MagentoFrameworkTranslateInlineInterface $translateInline
    * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
    * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
    * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
    * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
    * @param OrderManagementInterface $orderManagement
    * @param OrderRepositoryInterface $orderRepository
    * @param LoggerInterface $logger
    * @param MagentoFrameworkViewLayoutFactory $layoutFactory
    *
    * @SuppressWarnings(PHPMD.ExcessiveParameterList)
    * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
    */
    public function __construct(
    ActionContext $context,
    MagentoFrameworkRegistry $coreRegistry,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkTranslateInlineInterface $translateInline,
    MagentoFrameworkViewResultPageFactory $resultPageFactory,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
    MagentoFrameworkControllerResultRawFactory $resultRawFactory,
    OrderManagementInterface $orderManagement,
    OrderRepositoryInterface $orderRepository,
    LoggerInterface $logger,
    MagentoFrameworkViewLayoutFactory $layoutFactory,
    MagentoFrameworkHTTPZendClientFactory $httpClientFactory
    )
    $this->layoutFactory = $layoutFactory;
    $this->_httpClientFactory = $httpClientFactory;
    parent::__construct(
    $context,
    $coreRegistry,
    $fileFactory,
    $translateInline,
    $resultPageFactory,
    $resultJsonFactory,
    $resultLayoutFactory,
    $resultRawFactory,
    $orderManagement,
    $orderRepository,
    $logger
    );




    Try this. After making changes clear generated folder and flush cache. It may work for you.






    share|improve this answer





























      0














      I think you are forgetting to add use statement for certain classes like




      ActionContext $context,



      OrderManagementInterface $orderManagement,



      OrderRepositoryInterface $orderRepository




      etc. Also, I'm not able to see any namespace for your class.
      Your file should look like below.



      <?php

      namespace [Vendors][Module]ControllerAdminhtml;

      use MagentoBackendAppAction;
      use MagentoSalesApiOrderManagementInterface;
      use MagentoSalesApiOrderRepositoryInterface;
      use MagentoFrameworkExceptionNoSuchEntityException;
      use MagentoFrameworkExceptionInputException;
      use PsrLogLoggerInterface;

      class Custom extends MagentoSalesControllerAdminhtmlOrder

      /**
      * @var MagentoFrameworkViewLayoutFactory
      */
      protected $layoutFactory;

      /**
      * @param ActionContext $context
      * @param MagentoFrameworkRegistry $coreRegistry
      * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
      * @param MagentoFrameworkTranslateInlineInterface $translateInline
      * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
      * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
      * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
      * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
      * @param OrderManagementInterface $orderManagement
      * @param OrderRepositoryInterface $orderRepository
      * @param LoggerInterface $logger
      * @param MagentoFrameworkViewLayoutFactory $layoutFactory
      *
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
      */
      public function __construct(
      ActionContext $context,
      MagentoFrameworkRegistry $coreRegistry,
      MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
      MagentoFrameworkTranslateInlineInterface $translateInline,
      MagentoFrameworkViewResultPageFactory $resultPageFactory,
      MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
      MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
      MagentoFrameworkControllerResultRawFactory $resultRawFactory,
      OrderManagementInterface $orderManagement,
      OrderRepositoryInterface $orderRepository,
      LoggerInterface $logger,
      MagentoFrameworkViewLayoutFactory $layoutFactory,
      MagentoFrameworkHTTPZendClientFactory $httpClientFactory
      )
      $this->layoutFactory = $layoutFactory;
      $this->_httpClientFactory = $httpClientFactory;
      parent::__construct(
      $context,
      $coreRegistry,
      $fileFactory,
      $translateInline,
      $resultPageFactory,
      $resultJsonFactory,
      $resultLayoutFactory,
      $resultRawFactory,
      $orderManagement,
      $orderRepository,
      $logger
      );




      Try this. After making changes clear generated folder and flush cache. It may work for you.






      share|improve this answer



























        0












        0








        0







        I think you are forgetting to add use statement for certain classes like




        ActionContext $context,



        OrderManagementInterface $orderManagement,



        OrderRepositoryInterface $orderRepository




        etc. Also, I'm not able to see any namespace for your class.
        Your file should look like below.



        <?php

        namespace [Vendors][Module]ControllerAdminhtml;

        use MagentoBackendAppAction;
        use MagentoSalesApiOrderManagementInterface;
        use MagentoSalesApiOrderRepositoryInterface;
        use MagentoFrameworkExceptionNoSuchEntityException;
        use MagentoFrameworkExceptionInputException;
        use PsrLogLoggerInterface;

        class Custom extends MagentoSalesControllerAdminhtmlOrder

        /**
        * @var MagentoFrameworkViewLayoutFactory
        */
        protected $layoutFactory;

        /**
        * @param ActionContext $context
        * @param MagentoFrameworkRegistry $coreRegistry
        * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
        * @param MagentoFrameworkTranslateInlineInterface $translateInline
        * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
        * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
        * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
        * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
        * @param OrderManagementInterface $orderManagement
        * @param OrderRepositoryInterface $orderRepository
        * @param LoggerInterface $logger
        * @param MagentoFrameworkViewLayoutFactory $layoutFactory
        *
        * @SuppressWarnings(PHPMD.ExcessiveParameterList)
        * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
        */
        public function __construct(
        ActionContext $context,
        MagentoFrameworkRegistry $coreRegistry,
        MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
        MagentoFrameworkTranslateInlineInterface $translateInline,
        MagentoFrameworkViewResultPageFactory $resultPageFactory,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
        MagentoFrameworkControllerResultRawFactory $resultRawFactory,
        OrderManagementInterface $orderManagement,
        OrderRepositoryInterface $orderRepository,
        LoggerInterface $logger,
        MagentoFrameworkViewLayoutFactory $layoutFactory,
        MagentoFrameworkHTTPZendClientFactory $httpClientFactory
        )
        $this->layoutFactory = $layoutFactory;
        $this->_httpClientFactory = $httpClientFactory;
        parent::__construct(
        $context,
        $coreRegistry,
        $fileFactory,
        $translateInline,
        $resultPageFactory,
        $resultJsonFactory,
        $resultLayoutFactory,
        $resultRawFactory,
        $orderManagement,
        $orderRepository,
        $logger
        );




        Try this. After making changes clear generated folder and flush cache. It may work for you.






        share|improve this answer















        I think you are forgetting to add use statement for certain classes like




        ActionContext $context,



        OrderManagementInterface $orderManagement,



        OrderRepositoryInterface $orderRepository




        etc. Also, I'm not able to see any namespace for your class.
        Your file should look like below.



        <?php

        namespace [Vendors][Module]ControllerAdminhtml;

        use MagentoBackendAppAction;
        use MagentoSalesApiOrderManagementInterface;
        use MagentoSalesApiOrderRepositoryInterface;
        use MagentoFrameworkExceptionNoSuchEntityException;
        use MagentoFrameworkExceptionInputException;
        use PsrLogLoggerInterface;

        class Custom extends MagentoSalesControllerAdminhtmlOrder

        /**
        * @var MagentoFrameworkViewLayoutFactory
        */
        protected $layoutFactory;

        /**
        * @param ActionContext $context
        * @param MagentoFrameworkRegistry $coreRegistry
        * @param MagentoFrameworkAppResponseHttpFileFactory $fileFactory
        * @param MagentoFrameworkTranslateInlineInterface $translateInline
        * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
        * @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
        * @param MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
        * @param MagentoFrameworkControllerResultRawFactory $resultRawFactory
        * @param OrderManagementInterface $orderManagement
        * @param OrderRepositoryInterface $orderRepository
        * @param LoggerInterface $logger
        * @param MagentoFrameworkViewLayoutFactory $layoutFactory
        *
        * @SuppressWarnings(PHPMD.ExcessiveParameterList)
        * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
        */
        public function __construct(
        ActionContext $context,
        MagentoFrameworkRegistry $coreRegistry,
        MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
        MagentoFrameworkTranslateInlineInterface $translateInline,
        MagentoFrameworkViewResultPageFactory $resultPageFactory,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory,
        MagentoFrameworkControllerResultRawFactory $resultRawFactory,
        OrderManagementInterface $orderManagement,
        OrderRepositoryInterface $orderRepository,
        LoggerInterface $logger,
        MagentoFrameworkViewLayoutFactory $layoutFactory,
        MagentoFrameworkHTTPZendClientFactory $httpClientFactory
        )
        $this->layoutFactory = $layoutFactory;
        $this->_httpClientFactory = $httpClientFactory;
        parent::__construct(
        $context,
        $coreRegistry,
        $fileFactory,
        $translateInline,
        $resultPageFactory,
        $resultJsonFactory,
        $resultLayoutFactory,
        $resultRawFactory,
        $orderManagement,
        $orderRepository,
        $logger
        );




        Try this. After making changes clear generated folder and flush cache. It may work for you.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 9 hours ago









        Ansuman

        486




        486










        answered 10 hours ago









        Yash ShahYash Shah

        68618




        68618



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268455%2fhow-to-pass-custom-parameters-to-parent-construct%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form