When you’re converting you Magento modules to Magento 2, make sure your helper classes have a _moduleName
property.
protected $_moduleName='Packagename_Modulename'
I ran into an issue where the isModuleOutputEnabled
method relied on this value being set. If the property isn’t there, Magento will attempt to infer a module name via the helper’s _getModuleName
method
protected function _getModuleName()
{
if (!$this->_moduleName) {
$class = get_class($this);
$this->_moduleName = substr($class, 0, strpos($class, '\Helper'));
}
return str_replace(MagentoAutoloadIncludePath::NS_SEPARATOR, '_', $this->_moduleName);
}
but this method assumes you’ve converted your module to namespaces. For greenfield Magento 2 work, this will be fine — but I imagine most of us will be supporting Magento 1 during the eventual overlap period.