Questions tagged [construct]
The construct tag has no summary.
43 questions
0 votes
1 answer
120 views
Is it possible to override type configuration in the di.xml of a module in Magento2?
I want to override the file "Fooman\EmailAttachments\Observer\AbstractSendInvoiceObserver". Here is the code in the di.xml. <!-- module introduced preferences --> <preference for=&...
2 votes
3 answers
110 views
Extra parameters passed to parent construct $directoryHelper
I am getting the following error on di compile: **Extra parameters passed to parent construct $directoryHelper** That's the original code: class PreviewButton extends \Magento\Config\Block\System\...
0 votes
1 answer
32 views
Error on constructor while saving form into the database
Here is my save.php <?php namespace Mageplaza\Menu\Controller\Adminhtml\Post; use Mageplaza\Menu\Model\PostFactory; use Magento\Backend\App\Action; use Magento\Framework\App\Action\Context; use ...
1 vote
1 answer
1k views
Magento 2.4 constructing controller URL admin(backend) in JavaScript
I tried to make a simple ajax call to my controller, but I can't generate the url to make the request requirejs(['jquery', 'Magento_Ui/js/modal/confirm', 'mage/url'], function ($, confirmation, ...
0 votes
1 answer
706 views
Why is parent::__construct($context) used?
I have experience in programming with php and i think i have a good understanding of what a constructor does. But in Magento the constructor is called with the implemented Dependency's but after that ...
0 votes
1 answer
96 views
Block override issue in Magento2
I am overriding Google analytics block file. Here is my Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1 vote
0 answers
47 views
Is it possible to retrieve dependency injected arguments in another class?
Is it possible to retrieve dependency injected arguments in another class? For example, we have a class Vendor\Module\Block\Autocomplete. // app/code/Vendor/Module/Block/Autocomplete.php namespace ...
0 votes
0 answers
234 views
Custom Console command __cunstructor always gets an error in Magento 2.3
I have a console command class with constrcutor that looks like this: namespace Vendor\Module\Console\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\...