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

PHPStorm not open on Magento root #244

Closed
dmanners opened this issue May 5, 2020 · 8 comments
Closed

PHPStorm not open on Magento root #244

dmanners opened this issue May 5, 2020 · 8 comments
Assignees
Labels

Comments

@dmanners
Copy link

dmanners commented May 5, 2020

Describe the bug (*)

Using the PHPStorm plugin when having PHPStorm open a level above the Magento root seems to not show target modules when creating a plugin or any other option with the "Target Module" dropdown.

To Reproduce (*)

Steps to reproduce the behavior:

  1. Setup PHPStorm so that it is open one directory above the Magento root. E.g. ProjectName->src when src is the Magento root and project name contains other project-related files.
  2. Enable module,
  3. Go to a class in Magento,
  4. Right-click on the method name and select "Create a Plugin",

Expected behavior (*)

All modules under app/code to be shown in the "Target Module" drop-down

Screenshots

PHPStormBug

Please complete the following information: (*)

  • OS: Ubuntu
  • PhpStorm/Intellij version 2020.1.1
  • Version: 1.0.0

Additional context

I have tested this by using the same directory but opening only the Magento root. It could be that I do not have something correctly setup with the src folder but all the URNs are setup and navigation from the plugin seems to be working as expected.

@dmanners dmanners added the bug label May 5, 2020
@m2-community-project m2-community-project bot added this to Ready for Grooming in Community Backlog May 5, 2020
@coderimus
Copy link
Contributor

Hello @dmanners !
Thank you for your report. I made a test according to your request and this is the result:

  1. I created a folder
  2. Add the scr folder into it and in it create a new Magento CE project
  3. Open PHPStorm
  4. Target project root for PHPStrom on the src level so the Magento project is one level under
  5. Create 2 modules in the app/code
  6. Tried to create a plugin
  7. All 2 new modules appeared in the module selection dropdown
    image

I think that the problem, possibly, in the settings of your project. Please, check the Magento install path and if the problem would not be solved or my test was incorrect ping me :)

Example of my settings for Magento install path:
image

@dmanners
Copy link
Author

dmanners commented May 6, 2020

Thanks for looking at this @coderimus I have these settings and that also seems fine as it picks up the version of Magento as well. Like I said if I just open the src directory as a PHPStorm project everything works fine but when I have the main project root open and not Magento root it does not work :(

Are there any other PHPStorm seetings like source root that I need to take care of?

phpstorm-magentoroot

@dmanners
Copy link
Author

dmanners commented May 6, 2020

Ah I think I have found the problem with it. I have the PHPStorm project setup in a different directory as the actual code. And when I just open the directory with the code even with the multiple levels then it works well. I wonder if the module does not work with my setup.

Steps to get my setup:

  1. In PHPStorm create a new project and put it in any place. For me it's /home/dmanners/PhpstormProjects/ProjectName.
  2. Add the source root via the settings in PHPStorm and point to another directory. Using Settings->Directories and click "Add Content Root".

The reason I did this was in my old setup I had the content linked over a samba share. Technically now I do not need to run it this way but can simply put the project and content in the same place. But old habits die hard it seems.

This means I have my .idea settings under /home/dmanners/PhpstormProjects/ProjectName/.idea
but for example, some of the files are not set up correctly. The modules file is actually empty and not the same as if I open the folder directly.

@coderimus
Copy link
Contributor

Hello @dmanners ! Thank you for the detail explanation. It is an interesting case 👍 Let me reproduce it and I will return to you with an answer in few days :)

@VitaliyBoyko VitaliyBoyko added this to the 1.0.2 milestone May 8, 2020
@okorshenko
Copy link

@magento I am working on this

@okorshenko okorshenko removed their assignment May 14, 2020
@coderimus coderimus assigned coderimus and unassigned coderimus May 14, 2020
@coderimus
Copy link
Contributor

@magento I am working on this

@bohdan-harniuk
Copy link
Collaborator

Hello, @dmanners!

Is it still actual for you?
The settings mentioned by @coderimus should cover case if you want to have Magento src folder under the project directory.
So, if it is the expected behaviour, we can close this issue.
What do you think?

Regards,

@bohdan-harniuk bohdan-harniuk self-assigned this Jan 23, 2022
@bohdan-harniuk bohdan-harniuk removed this from the 2.0.0 milestone Jan 24, 2022
@bohdan-harniuk
Copy link
Collaborator

Hello, @dmanners!

I am closing this issue as it seems that everything is working as expected.
If you want us to proceed with development here, please, reopen this issue and add as many details as you can.

Regards,

Community Backlog automation moved this from Ready for Development to Done Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants