From f156308aef6fc025237b2d021eea826feea4ce80 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Jul 2008 09:40:46 -0400 Subject: [PATCH] attachment: Fix an uninitialised value warning when editing a page that currently has no attachments. --- IkiWiki/Plugin/attachment.pm | 3 ++- debian/changelog | 2 ++ doc/bugs/attachment:_failed_to_get_filehandle.mdwn | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index cb762e453..90e0f0f0b 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -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 { diff --git a/debian/changelog b/debian/changelog index 8d404f32f..8cd0084f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 07 Jul 2008 01:52:48 -0400 diff --git a/doc/bugs/attachment:_failed_to_get_filehandle.mdwn b/doc/bugs/attachment:_failed_to_get_filehandle.mdwn index 3ce7e62ac..fadc2f87f 100644 --- a/doc/bugs/attachment:_failed_to_get_filehandle.mdwn +++ b/doc/bugs/attachment:_failed_to_get_filehandle.mdwn @@ -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 -- 2.44.0