Non project files protection when editing files from the project

This started happening after I updated to PhpStorm 2021.2. I opened up a WordPress project in the project root (where wp-config.php is located) and when I want to edit a file in my theme I get the 'You are trying to edit a non-project file' (file protection window).

I tried invalidating the cache, deleting the .idea folder, but the same thing happens every time I reopen the project.

I'm on Win 10, the about details are:

PhpStorm 2021.2
Build #PS-212.4746.100, built on July 28, 2021
Runtime version: 11.0.11+9-b1504.13 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2038M
Cores: 16
Registry: debugger.watches.in.variables=false, run.processes.with.pty=TRUE, ide.experimental.ui.toolwindow.stripes=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: Statistic (4.1.7), com.intellij.ideolog (203.0.27.0), zielu.gittoolbox (212.7.5), com.mallowigi (38.0.0), name.kropp.intellij.makefile (212.4746.52), com.intellij.plugins.html.instantEditing (212.4746.57), com.laravel_idea.tailwind (1.3.1), com.dmarcotte.handlebars (212.4746.57), NEON support (0.5.1), com.chrisrm.idea.MaterialThemeUI (6.8.0.1), de.espend.idea.laravel (0.15.4), com.pestphp.pest-intellij (1.0.3), de.espend.idea.php.annotation (8.0.0), fr.adrienbrault.idea.symfony2plugin (0.23.210), ru.adelf.idea.dotenv (2021.3.0.212) 
14 comments
Comment actions Permalink

Hi there,

As a starting point: please show a screenshot of the whole IDE window; should show the Project View panel with that file opened and focused in particular (use Default or Darcula theme please, not custom ones -- colors used can be important here) -- this may give some clues on what situation you have got there.

0
Comment actions Permalink

It seems to be an intermitten issue. Sometimes it happens, sometimes it doesn't. Could the custom theme be the issue? I'm using the material theme.

0
Comment actions Permalink

Here' the screenshot when I'm trying to edit a file in my project

0
Comment actions Permalink

Theme: unlikely (it is just weird colors since I'm not familiar with them and do not know what underwave or that color may be saying when used more familiar theme)..

Anyway: where the project is located? What is the root folder path?

0
Comment actions Permalink

Basically, I do not like this part:

It should not be like that. For example: one of my projects:

Right now it feels like the project is the whole Z:\ drive.... But that still would not describe the popup. So it's better to see the whole pic/more details.

0
Comment actions Permalink

The project root is the mounted WSL folder. I have mapped it to the Z drive so it's `Z:\home\dzoljom\Sites\Personal\project-name`, the WSL path is `/home/dzoljom/Sites/Personal/project-name`. Windows usually refers the Z: 'drive' as \\wsl$.

 

0
Comment actions Permalink

No.

Look at the highlighted sections on my screenshot and what you have at your -- see the difference?

I do not see the project name there -- I see a full path from the Z:\ drive root.

What is the project root folder (on Windows)?

  • Please scroll up the Project View to the very top and show that.
  • Please also show your "Settings | Directories"
  • Show how the project looks on the Welcome screen (shown when all projects are closed)
1
Comment actions Permalink

Ok, that is super odd. On my other project, it says the project name with a little icon of a laptop, and below is the Project folder icon, and then the folder that is pointing to the folder where the project is.

I can see the External Libraries and Scratches and Consoles differently than in the problematic project.

 

My Settings > Directories is empty O.o

0
Comment actions Permalink

Ok, I closed the project, deleted it from my project list, and created a new one from the \\wsl$\Ubuntu-20.04\home... directory. Now it looks ok, and doesn't report the issue when opening the config file.

Not sure how I managed to do that one tbh 🤷‍♂️

1
Comment actions Permalink

Ok, that is super odd. On my other project, it says the project name with a little icon of a laptop, and below is the Project folder icon, and then the folder that is pointing to the folder where the project is.

Sorry. No ideas what you are talking here. Could be some icons specific to Material UI Theme.

You would need to switch to one of the default themes to have a better support on this bit.

My Settings > Directories is empty O.o

Looks like the project config files might be corrupted .. or some plugin.

Please disable ALL custom (not bundled by default) plugins, restart IDE and see if it helped.

If no changes then try this:

  1. Close IDE
  2. Go to Project root folder and backup and delete .idea subfolder (contains project settings)
  3. Launch IDE again
  4. Use "Open" and point to the project root folder -- PhpStorm will create a new project from existing files.
  5. Configure it as needed (most of the config stuff can be copied over from the old/backup -- while IDE is closed, ofc)
1
Comment actions Permalink

I was also having this problem. PHPStorm decided to mark the root of my repo as a non-project folder and as a result I started getting the warning when editing legitimate VC files within in.

Deleting the .idea sub-folder resolved my issue.

0
Comment actions Permalink

@Kevin Ottley

Do you share .idea in your VCS? If you do ... and you were switching branches or alike -- one of the config files (modules.xml AFAIR) may got wrong (no longer actual) path. If you are interested in knowing that for sure: make a backup of .idea before deleting it when/if it will happen again.

1
Comment actions Permalink

Same problem.  Exiting PHP Storm and deleting the .idea then opening it backup worked.

0
Comment actions Permalink

I removed `/home/xxx/.cache/JetBrains` directory and created Project from scratch and it helps.

The downside is that all project will be lost, however IDE Settings stays as they were.

0

Please sign in to leave a comment.