Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sampledata:deploy/remove when custom module located app/code has no composer.json #4636

Closed
andrew-smart opened this issue May 23, 2016 · 4 comments

Comments

@andrew-smart
Copy link
Contributor

Steps to reproduce

  1. Install Magento
  2. Create a custom module (without composer file).
  3. Try installing the sample data (bin/magento sampledata:deploy)

[ErrorException]
file_get_contents([path]/app/code/[Vendor]/[ModuleName]/composer.json): failed to open stream: No such file or directory

Although in most cases you would have a composer file it seems a trivial task to just check if the composer file exists in app/code/Magento/SampleData/Model/Dependency.php

Happy to send a pull request if this is not intended behaviour to force people to create composer files though

@oserediuk
Copy link
Contributor

Hello! Please, provide the used version. If the problem is actual for a specific branch, please, specify it and be sure that the latest update was used.

@palamar
Copy link
Contributor

palamar commented Jul 7, 2016

According to contributor guide, tickets without response for two weeks should be closed.
Please feel free to reopen if it's needed.

@palamar palamar closed this as completed Jul 7, 2016
@robfico
Copy link
Contributor

robfico commented Aug 31, 2016

2.1.1 store, tried to remove sample data, same result:
bin/magento sampledata:remove

Warning: file_get_contents(/home/XXX/www/app/code/Smartwave/Porto/composer.json): failed to open stream: No such file or directory in /home/XXX/www/vendor/magento/module-sample-data/Model/Dependency.php on line 109

@thdoan
Copy link

thdoan commented Sep 28, 2016

I'm getting a similar error when running magento sampledata:deploy on Magento 2.1.1:

 [Exception]
  Warning: file_get_contents(path/to/app/code/Vendor/SomeModule/composer.json): failed to open stream: No such file or directory in path/to/vendor/magento/module-sample-data/Model/Dependency.php on line 109

The only solution I could find was https://mage2.pro/t/topic/327.

UPDATE: I just applied the patch from above and can confirm that it works :). The only difference is I modified this file: vendor/magento/module-sample-data/Model/Dependency.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants