X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=IkiWiki%2FPlugin%2Fattachment.pm;h=2d1fe51cf090b0f70595104217bd8d01b34ab0f9;hb=c9459523813052ee187bdad1c8594ae114bece62;hp=8379928418fd997922a574bc59f68c79415251d4;hpb=e0fd02acf1d40d8f049a7f470e07eebad28cab3d;p=ikiwiki.git diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 837992841..2d1fe51cf 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -94,7 +94,8 @@ sub formbuilder_setup (@) { #{{{ my $form=$params{form}; my $q=$params{cgi}; - if (defined $form->field("do") && $form->field("do") eq "edit") { + if (defined $form->field("do") && ($form->field("do") eq "edit" || + $form->field("do") eq "create")) { # Add attachment field, set type to multipart. $form->enctype(&CGI::MULTIPART); $form->field(name => 'attachment', type => 'file'); @@ -158,7 +159,7 @@ sub formbuilder (@) { #{{{ my $form=$params{form}; my $q=$params{cgi}; - return if ! defined $form->field("do") || $form->field("do") ne "edit"; + return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ; my $filename=$q->param('attachment'); if (defined $filename && length $filename &&