User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20101203 (CK-xxxxxxxxxx) Firefox/3.6.13 (.NET CLR 3.5.30729) Build Identifier: Bugzilla 4.0 RC1 Each time my extension gets loaded and used, I get a warning in my error_log. The extension is the single module type, MyExtension.pm, and contains no templates or other libraries. Per the following page on debian, this error can be suppressed by adding a "no warnings 'once';" command to the code segment in Bugzilla/Install/Util.pm on line 225. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521609 The interesting part is that this error isn't thrown for other extensions even though the errant variable, Bugzilla::Extension::MyExtension::EXTENSION_PACKAGE_DIR, is not used or defined ANYWHERE else but this line. There is no documentation for it, and without knowing the whole extension architecture I see no need for it. Perhaps it needs to be documented and the errors ignored. Reproducible: Always
Created attachment 500221 [details] [diff] [review] patch v1 for 4.0RC1 This patch suppresses the warning.
I've never seen this error. Suppressing a warning is not something we want to, and shouldn't happen. Perhaps there is some other problem with your extension?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
This problem is only seen for extensions that are Single File types. Reopening per Max's suggestion on support-bugzilla
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Summary: Simple extensions throw 'used only once' warnings when called → Single-file extensions throw 'used only once' warnings when called
confirming, however i see this on non-single-file extensions too: Util.pm: Name "Bugzilla::Extension::Voting::EXTENSION_PACKAGE_DIR" used only once: possible typo at Bugzilla/Install/Util.pm line 228. Win32 strawberryperl 126.96.36.199
Status: UNCONFIRMED → NEW
Ever confirmed: true
Created attachment 513385 [details] [diff] [review] alternative patch while EXTENSION_PACKAGE_DIR is undocumented and looks like it can be removed, it's an arbitrary name used to derive the class's path when the $file argument isn't specified. rather than suppressing the warning, this patch uses __FILE__ instead, which won't trigger the warning.
Comment on attachment 513385 [details] [diff] [review] alternative patch this is wrong
Created attachment 513393 [details] [diff] [review] patch v2 as per miketosh's patch, just ignore the warning, but also add a comment to avoid future confusion.
Comment on attachment 513393 [details] [diff] [review] patch v2 Awesome, thank you so much. :-)
Attachment #513393 - Flags: review?(mkanat) → review+
Target Milestone: --- → Bugzilla 4.0
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Install/Util.pm Committed revision 7724. Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/ modified Bugzilla/Install/Util.pm Committed revision 7561.
Status: NEW → RESOLVED
Last Resolved: 7 years ago → 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.