0

[EDIT]

Added screenshot showing can't run any of the CLI commands being suggested:

CLI not working

[/EDIT]

Implemented add new table official learning module (http://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/) with no issues.

Implemented add new product attribute official learning module (http://devdocs.magento.com/videos/fundamentals/add-new-product-attribute/), and the # magento setup:upgrade step yields:

magento_user@ubuntu:/var/www/html/magento.dev/app/code/Learning/ClothingMaterial/Setup# magento setup:upgrade Notice: Undefined index: websites in /var/www/html/magento.dev/vendor/magento/module-config/App/Config/Type/System.php on line 248

Now I'm getting the install screen when I visit the store.

Welcome to Magento Admin, your online store headquarters. Click 'Agree and Set Up Magento' or read Getting Started to learn more.

Tried uninstalling the module # magento module:disable Learning_ClothingMaterial --clear-static-content and re-running # magento setup:upgrade amd # magento setup:di:compile but upgrade yields same error as above and compile yields:

[Exception] Warning: array_replace_recursive(): Argument #1 is not an array in /var/www/html/magento.dev/vendor/magento/fram
ework/App/DeploymentConfig/Writer.php on line 135

It's impressive that following along with an official tutorial causes this level of destruction. Really hope there's an easy fix, as have had to re-install a half-dozen times now due to very similar issues.

Env: a vanilla composer CE 2.2 sandbox, on a bare metal Ubuntu 16 LAMP with PHP 7.1.

2 Answers 2

1

If you want to uninstall it:

-> go to Database

-> go to setup_module

-> find Learning_ClothingMaterial

-> delete row

-> clear cache with php bin/magento cache:clean

-> clear generated by deleting content of the folder /generated

-> run setup upgrade with php bin/magento setup:upgrade

-> recompile website with php bin/magento setup:static-content:deploy

Update

Not sure why you do not need to use php bin/magento because the magento commands should be in the bin folder.

I can tell you in developer mode you need to add '-f' to the command like php bin/magento -f setup:static-content:deploy

I can also tell you if its not the bin/magento and you are still getting the 'there are no commands defined in the ... namespace' it means that a class was not used (on top of you php file you need to include your classes by adding 'use Magento/.../..." or badly used in the __construct of your php files.

You can just delete the module files and directories that you created , delete the setup_module and recompile.

If you want to get the module working then you need to go and comment out every class that you used until it works.

To provide more assistance on that i will need to see your code.

4
  • Deleted Learning_ClothingMaterial from setup_module table, and deleted content from /generated. # magento cache:clean fails: [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "cache" namespace. Nov 2, 2017 at 15:46
  • Added screenshot to OP showing CLI output for the commands you recommended. Nov 2, 2017 at 16:25
  • Updated my answer Nov 3, 2017 at 3:47
  • Running export PATH=$PATH:/var/www/html/magento.dev/bin makes magento a shortcut for php bin/magento. Static content deployment fails with -f as well. All custmizations added were copy/pasted from this official magento tutorial, so if the usings or contructors are erroneous... Yes, I deleted all flat file content added for the tutorial. As such, there's no code for you to see... this was a functioning vanilla CE 2.2 sandbox with no customization apart from the two training modules noted in the OP. Nov 3, 2017 at 15:48
0

Try this in your custom module module.xml file

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Namespace_Modulename" setup_version="1.0.0">
</module>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.