Technology Blog

Archive for November, 2015

Magento 2 Attribute ‘setup_version’ is missing for module

by on Nov.29, 2015, under Magento, Web Development

WHen greeted by the error message:

Attribute 'setup_version' is missing for module

This is because the attribute schema_version has changed to setup_version at some point in the M2 development cycle.



Should now be:



Leave a Comment more...

Magento 2 Recoverable Error: Argument 1 passed to Training\Test\Controller\Action\Config::__construct() must be an instance of Magento\Framework\App\Action\Context

by on Nov.29, 2015, under Magento, Web Development

I’m creating the test module form the Magento 2 Development Fundamentals course from Magento and ran accross the below error:

Recoverable Error: Argument 1 passed to Training\Test\Controller\Action\Config::__construct() must be an instance of Magento\Framework\App\Action\Context

I found out that the example they gave, they omitted the constructor in the Config.php controller. So let’s add that in:


public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}

Then lastly, since I already tried to run it, I had to clear out some of my var folders and then recompile:


[bessig@dev htdocs]$ sudo rm -Rf var/generation/*
[bessig@dev htdocs]$ sudo rm -Rf var/di
[bessig@dev htdocs]$ sudo rm -Rf var/cache/*
[bessig@dev htdocs]$ sudo rm -Rf var/page_cache/*
[bessig@dev htdocs]$ bin/magento setup:di:compile

Hopefully this helps someone.

Also they did not supply a routes.xml The one I used is as follows:











The page you will call using this route will be: /testing/action/config

Hopefully this saves someone some time! Let me know if your one of the people it helped!

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...