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.
When right-clicking on a folder and select new smartye template, it creates the file in the root instead of the selected directory. Product Version = NetBeans IDE 7.1.1 (Build 201203012225) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.6.0_24 Runtime = Java HotSpot(TM) Client VM 19.1-b02
typo
Could not reproduce in daily build. Can you provide the exact sequence that leads to the faulty behavior (directory names, smart template type, etc.) ? Can you provide the project in which this is happening ? Reassigning to Project UI.
Created attachment 118043 [details] Screenshot of New File window
How to recreate: - select a file in the root inside the projectswindow - rightclick on a folder - select new -> smarty/php (doesn't matter which) - Now you see the the window with blank inputs - When creating, it places the file in the rootfolder It doens't happen every single time but I have this with all my projects. I've enclosed a screenshot.
Was able to reproduce this just the first time I tried it (with New > Empty File in a j2seproject, selecting src/ in Files), but not thereafter. Might be some kind of race condition. No guesses as to what might cause it. Workaround is simply to use the Browse button to select the desired folder before finishing the wizard.
Easier workaround (less clicks): - create file without folder - drag the file to the appropriate directory
If you know how to consistently (or usually) reproduce this _from scratch_ please comment here, since I probably cannot fix anything unless I can reproduce.
Created attachment 118104 [details] Screencast of bugreproduction Screencast of bugreproduction added
Following what I think are the exact steps in the video, I cannot reproduce. Each time, whether or not I have previously canceled the New File wizard, it offers to create the new file as ".../projname/bugtest/newSmartyTemplate.tpl" as expected. Checked in a dev build on Ubuntu; same in 7.1.1 on XP.
Sorry but I forgot to mention I only use right mousebutton when clicking on a folder. I'm using windows 7 (32bit)
Yes, I used the right mouse button too; that was my only guess as to the cause.
Is there anything else I can do to help find/resolve this bug?
1. Code-level debugging could turn up the problem, only of course if you are familiar with the code or can get familiar with it. 2. If there is a known way to reproduce this from scratch on an arbitrary machine, using a fresh NetBeans installation and user directory, that would certainly help. It could be that the bug only appears on your current computer (for some unknown reason). 3. I added some diagnostic code which should at least narrow down the possible problems. -J-Dorg.netbeans.modules.project.ui.actions.NewFile.level=0 (added to e.g. netbeans.conf) would enable the diagnostics, which would be printed to your log file. These will be available in a nightly development build; an automated note will be attached to this page when that happens.
Integrated into 'main-golden', will be available in build *201204140400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1caa40380203 User: Jesse Glick <jglick@netbeans.org> Log: Diagnostics for #210919.
I can confirm that it has happned to me several times as well (and I am not the only one). But unfortunately no reliable steps to reproduce.
Created attachment 118416 [details] Recreated with nightly build Recreated with nightly build
*** Bug 211343 has been marked as a duplicate of this bug. ***
How do I add the logfile to the bugreport? Apparently I made a new issue (http://netbeans.org/bugzilla/show_bug.cgi?id=211343)
Click on "Add an attachment" and select your .../var/log/messages.log file.
Still working for me in a dev build on Ubuntu using a PHP-only build.
Created attachment 118431 [details] Log file from nightly build As found in C:\Users\Name\AppData\Roaming\NetBeans\dev\var\log
This log file is not particularly helpful since -J-Dorg.netbeans.modules.project.ui.actions.NewFile.level=0 was not used to enable diagnostics. Can you reproduce using a fresh user directory? If not, you should be able to use bisection to determine what part of your existing user directory is triggering the problem, which could lead to steps to reproduce.
I'll do a reinstall with a new user next monday.
Not necessary to reinstall anything, just run with a different user directory: --userdir ... on the command line, or edit the location given in etc/netbeans.conf.
Created attachment 118554 [details] Correct logfile
Created attachment 118558 [details] Added -J-Dorg.netbeans.modules.project.ui.actions.NewFile.level=0 I've added -J-Dorg.netbeans.modules.project.ui.actions.NewFile.level=0 to the .conf file
OK, log shows NewFile correctly getting the "folder" subfolder of the project and calling TemplateWizard.setTargetFolder. Sometime later, SimpleTargetChooserPanel calls Templates.getTargetFolder, which delegates to TemplateWizard.getTargetFolder, and gets the wrong result: the project root dir. Why? I do not know, though the fix for (ancient) bug #29661 at the top of NewTemplateAction looks suspicious. I have added further diagnostics in core-main #8528a0e65d66. When these appear in a dev build, please run with -J-Dorg.openide.loaders.TemplateWizard.level=FINE and again attach your log file produced while reproducing the problem.
Integrated into 'main-golden', will be available in build *201204210400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/8528a0e65d66 User: Jesse Glick <jglick@netbeans.org> Log: More #210919 diagnostics.