This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250930 - Cannot create file in subfolder with composer.json
Summary: Cannot create file in subfolder with composer.json
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-05 15:12 UTC by Vladimir Riha
Modified: 2015-03-13 12:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-03-05 15:12:31 UTC
Please try following:
 - create a new PHP project
 - add PHPUnit as a dependency using Composer
 - in Projects view, right click on vendor/phpunit/php-code-coverage folder and select New->PHP Class

 => the opened dialog says

"No source folders in project; perhaps it has been deleted?"

 and Next button is disabled.



Thank you


Product Version: NetBeans IDE Dev (Build 201503040001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 1 waldermort 2015-03-05 16:48:32 UTC
I can confirm the problem. Workaround:

right click > new > Other > select main project name > select type of file to add.
Comment 2 Tomas Mysik 2015-03-06 06:12:43 UTC
Láďo, could you please try it for HTML5 project with some node_module with package.json? I guess it could be related to project convertors.

Thanks.
Comment 3 Vladimir Riha 2015-03-06 07:58:46 UTC
It looks like it works for JS/HTML files (not Less/Sass due to issue 250931) for node_modules/bower components.

I can also create JS file in the "php-code-coverage" from initial description, the problem seems to be with PHP files (but perhaps could occur with other file types...)
Comment 4 waldermort 2015-03-06 09:26:28 UTC
I am testing this under the vedor directory in a Symfony project. It doesn't work for any of the file types suggested under right click - new, including HTML/js files.

The "new xxx file" dialogue pops up with the wrong project name. Trying to add files under that name causes the error. Selecting back, then choosing the correct project resolves the problem.

The wrong project name comes from a composer.json within the vendor directory.
Comment 5 Vladimir Riha 2015-03-06 09:34:14 UTC
Would you mean it does not work? Can you create the file? Or it is just the project name that is wrong?
Comment 6 waldermort 2015-03-06 09:42:21 UTC
It does not work when the wrong project name is chosen. When the main project name is chosen files can be added.
Comment 7 Vladimir Riha 2015-03-06 09:46:13 UTC
Interesting, it works for me for JS/HTML files
Comment 8 waldermort 2015-03-06 10:14:54 UTC
That is strange. I wonder if it has anything to do with cache. My IDE was freshly installed yesterday (removed ALL netbeans files first).

When I try creating a new file in the vendor directory (under a second composer.json) I am only offered 4 files types. Folder, PHP class, PHP file and twig HTML template. Yet, under the one vendor directory I am working on (/project/vendor/acme/bundle), I have many more (PHP interface, SASS file, LESS file...).

I symlinked this working directory (/project/vendor/acme/bundle) into /project/src/acme. There I am reduced to the 4 file types again.

Whether I try to create a file in /project/vendor/acme/bundle or /project/src/acme/bundle (symlink) the new file dialogue always contains the project name of 'acme'. I have to change this to the real name before I can create the file otherwise I get the error "No source folders in project; perhaps it has been deleted?"
Comment 9 waldermort 2015-03-06 10:28:15 UTC
The point I was trying above, is that when you select new -> filetype, the dialogue skips the project name prompt (you have to click back to change it). when you select new -> Other, it opens the first page directly.
Comment 10 Tomas Mysik 2015-03-12 10:51:10 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/d2ee83d2b081
Comment 11 Quality Engineering 2015-03-13 03:13:23 UTC
Integrated into 'main-silver', will be available in build *201503130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d2ee83d2b081
User: Tomas Mysik <tmysik@netbeans.org>
Log: #250930 - Cannot create file in subfolder with composer.json
Comment 12 Vladimir Riha 2015-03-13 12:45:52 UTC
Verified, thank you

Product Version: NetBeans IDE Dev (Build 201503130001)
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)