I have a block which extends/overwrites the Magento block:
\Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo
This works perfectly. However in one of my classes I want to access a Helper, and so I added the consutructor
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Vendor\Name\Helper\SomeHelper $someHelper,
array $data = []
) {
parent::__construct($context, $data);
$this->someHelper = $someHelper;
}
public function getSomething(){
return $this->someHelper->getSomething();
}
Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo::__construct() must implement interface Magento\Customer\Api\AccountManagementInterface, array given, called in \app\code\retracted\retracted\Block\AdminOverrideBlocks.php on line 144 and defined in \vendor\magento\module-customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo.php on line 126 ( ! ) TypeError: Argument 2 passed to Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo::__construct() must implement interface Magento\Customer\Api\AccountManagementInterface, array given, called in \app\code\retracted\retracted\Block\AdminOverrideBlocks.php on line 144 in \vendor\magento\module-customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo.php on line 126
I know that the helper works, thats no problem. But this constructor overwrites the one on the Orginal Magento block - which causes errors.
I don't really want to copy and paste the entire constructor from the Magento block for various reasons (bound to cause issues down the road, not exactly elegant) and even when I tried this, I couldn't get past all the errors.
Is there a way to do it as a above but have the constructor inherited as opposed to overwrite? Or is there another way to access the helper without the requirement of the constructor?