attachment: Fix an uninitialised value warning when editing a page that currently...
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 13:40:46 +0000 (09:40 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 13:40:46 +0000 (09:40 -0400)
IkiWiki/Plugin/attachment.pm
debian/changelog
doc/bugs/attachment:_failed_to_get_filehandle.mdwn

index cb762e453e9f92c368fed3784c1ad5820455e6f6..90e0f0f0b1e7b8e419cf1d1679d751d10a8e54b6 100644 (file)
@@ -34,7 +34,8 @@ sub formbuilder_setup (@) { #{{{
                # Start with the attachments interface toggled invisible,
                # but if it was used, keep it open.
                if ($form->submitted ne "Upload Attachment" &&
-                   ! length $q->param("attachment_select")) {
+                   (! defined $q->param("attachment_select") ||
+                   ! length $q->param("attachment_select"))) {
                        $form->tmpl_param("attachments-class" => "toggleable");
                }
                else {
index 8d404f32f1d8f51534a54d5500e843ad9e0883b0..8cd0084f9ac73b508dd47fd66b0596c294a625a3 100644 (file)
@@ -2,6 +2,8 @@ ikiwiki (2.53) UNRELEASED; urgency=low
 
   * search: generate configuration files once only when rebuilding
     (Gabriel McManus)
+  * attachment: Fix an uninitialised value warning when editing a page
+    that currently has no attachments.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 07 Jul 2008 01:52:48 -0400
 
index 3ce7e62ac43737b98553537b1a46570cd8d0c63f..fadc2f87f5556f77c471f2b181a0b0b8bcc8930c 100644 (file)
@@ -9,6 +9,8 @@ following warning:
 
     Use of uninitialized value in length at /usr/share/perl5/IkiWiki/Plugin/attachment.pm line 36.
 
+> This is unrelated, I've fixed the warning message. --[[Joey]]
+
 Is it Ikiwiki bug or my attachment plugin is misconfigured? --[[PaweĊ‚|ptecza]]
 
 > Joey, please fix the colon in page name of my report. Ikiwiki sets