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.
Product Version = NetBeans IDE 7.0 RC1 (Build 201103280000) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.6.0_17 Runtime = Java HotSpot(TM) Client VM 14.3-b01 When one chooses "Source Files" -> Right-Click -> New PHPClass, the Class file is created but placeholders don't get replaced by actual values. the file content becomes <?php <#assign licenseFirst = "/* "> <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "../Licenses/license-${project.license}.txt"> /** * Description of ${name} * * @author ${user} * @copyright [This gets replaced though] * @version 1.0.0 * @created ${date?date?string("yyyy-MM-dd")} ${time?time?string("HH:mm:ss")} * @date ${date?date?string("yyyy-MM-dd")} ${time?time?string("HH:mm:ss")} */ class ${name} { public $Var1; public $Var2; public function fnFunctionName() { // } } But when I use the menu [File -> New File], ${user} and ${name} are replaced. The other variables don't show up.
Can you try it using "dev" version? (http://bits.netbeans.org/download/trunk/nightly/latest/) Because it works for me properly...but I'm using Ubuntu. So can you try it please? Thanks.
(In reply to comment #1) > Can you try it using "dev" version? > (http://bits.netbeans.org/download/trunk/nightly/latest/) Because it works for > me properly...but I'm using Ubuntu. So can you try it please? Thanks. Even the DEV build does not solve this problem. But one extra detail is that I have a custom template (in my ${HOME}/.netbeans/${VER}/config/Templates/Scripting). And it works fine in NB 6.8 and 6.9 The template has the text: <#assign licenseFirst = "/* "> <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "../Licenses/license-${project.license}.txt"> /** * Description of ${name} * * @author ${user} * @copyright NEFSYS * @version 1.0.0 * @created ${date?date?string("yyyy-MM-dd")} ${time?time?string("HH:mm:ss")} * @date ${date?date?string("yyyy-MM-dd")} ${time?time?string("HH:mm:ss")} */ class ${name} { public $Var1; public $Var2; public function fnFunctionName() { // } }
I am getting this as well on NetBeans IDE 7.0 (Build 201104080000), Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03, on System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb). However, I have noticed something odd that may be of help. If I select a folder in the Projects explorer tree, then go to File Menu -> New File -> PHP -> PHP Class -> Finish, then I get a new editor window with the template values filled in correctly. If I select a folder in the Projects explorer tree, then right-click -> New -> PHP Class -> Finish, I also get an editor window with the template values filled in correctly. However, I have noticed that when I right click in the Projects tree, there are actually TWO options for a new PHP class file. There is "PHP Class" and "PHPClass" (no space). The "PHPClass" appears to be the problem. If I select a folder in the Projects explorer tree, then right-click -> New -> PHPClass -> Finish (ie. the "no space" option), I get an editor window with the template values that are *not* filled in. I do not know where this option is coming from. If I go to Tools -> Templates -> PHP, I can only see the "PHP Class" (correct) template. The incorrect "PHPClass" does not show up. It does not appear anywhere in the Templates list in fact. Hope this helps.
I can not reproduce this. Probably it's somehow connecting with importing setting from one version to another one. Could you please send the list of files in config/Templates/Scripting folder and also content of .nbattrs file? Thanks.
I agree that it's probably an importing/upgrading issue, I don't recall seeing it when I was using 6.8 on a fresh install. In my ~\.netbeans directory I have a 7.0 and a 6.8 folder. Inside ~\.netbeans\7.0\config\Templates\Scripting there are two files: PHPClass PHPClass.php It seems the PHPClass file (no extension) contains the text that is not filled in properly, and the PHPClass.php file contains the text that is used correctly. I checked the ~\.netbeans\6.8\config\Templates\Scripting folder as a comparison, and there is only one file, the PHPClass (no extension) file, and it is the same as the one that is in the 7.0 folder. Looks like maybe it got imported during the upgrade but is now incorrect? My ~\.netbeans\7.0\config\.nbattrs file contains the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> <fileobject name=""> <attr name="Services\DiffProviders\org-netbeans-modules-diff-builtin-provider-BuiltInDiffProvider.settings\position" intvalue="100"/> </fileobject> </attributes> Cheers
My guess is that this could happen during importing fro one version to another one. Unfortunately I can not reproduce it, so this is just my guess.
Product Version: NetBeans IDE 7.1 (Build 201112071828) Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb) Greetings, I'm having exactly the same problem described by others, with the configuration above. File menu new class parses fine. Right-click context menu shows two "new php class" choices in the context. Both generate a file with the placeholders not replaced. I did have older versions (6.9, 6.8, 6.7.1). on the machine in question, and did import settings with each upgrade. I skipped 7.0. The 7.1 upgrade is the first place this behavior has happened.
Please, can you try it in 7.2 dev [1]? If the problem still occurs, reopen this issue. Thanks a lot. [1] http://bits.netbeans.org/download/trunk/nightly/latest/