0

I am trying to install a module Abcd_Core using the command

sudo php bin/magento setup:upgrade

The output does list all the modules except Abcd_Core. Also the app/etc/config.php does not have Abcd_Core in the array.

Here is what I did..


The module is located at <magento>/app/code/

The file

app/code/Abcd/Core/registration.php

has the code

\Magento\Framework\Component\ComponentRegistrar::register(
     \Magento\Framework\Component\ComponentRegistrar::MODULE,
     'Abcd_Core',
     __DIR__
 );

In app/code/Abcd/Core/etc folder I have module.xml, di.xml files and a folder adminhtml.

module.xml

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

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Store\Model\Store" type="Abcd\Core\Model\Store" />
</config>

The app/code/Abcd/Core/etc/adminhtml folder has routes.xml and system.xml.

There is a file app/code/Abcd/Core/Model/Store.php which overrides the functionality of method getBaseUrl().


I tried cleaning the cache and then running the setup:upgrade several times, also tried

sudo php bin/magento module:enable Abcd_Core

but unable to install/enable the module.

Can anyone provide some input on what needs to be corrected?

FYI, I cloned the files from a git repository in my organization.

Thank you, Hari CL

1 Answer 1

0

You also need a composer.json file:

{
  "name": "Abcd/Core",
  "description": "la",
  "type": "magento2-module",
  "version": "0.0.1",
  "license": [
    "OSL-3.0"
  ],
  "require": {

  },
  "extra": {
    "map": [
      [
        "*",
        "Abcd/Core"
      ]
    ]
  }
}

Also please clean everything in the var folder and flush the cache. If it still doesn't work, check the var/logs file.

3
  • Added composer.json with code{ "name": "Abcd/Core", "description": "Abcd Core Module", "type": "magento2-module", "version": "0.0.1", "license": [ "OSL-3.0" ], "require": { }, "extra": { "map": [ [ "*", "Abcd/Core" ] ] }, "autoload": { "files": [ "registration.php" ], "psr-4": { "Abcd\\Core\\": "" } } }
    – Hari CL
    Apr 15, 2016 at 9:29
  • Hi Claudiu, I added the composer.json but the issue persists. I tried to install the same module in a new Magento2 installation, and it worked. I think there should be some issue in the code added to the repository
    – Hari CL
    Apr 15, 2016 at 9:32
  • @HariCL possibly, check the error logs. it should be something there. also use -v in command line for more messahges Apr 15, 2016 at 9:38

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.