X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6c89a635bb0715fd06b0061692fe39b3e79fcad7..5959a32f9746aa600fd852f6b11f635ad2020253:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 82b619592..75f096e13 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -249,7 +249,7 @@ sub cgi_prefs ($$) { #{{{ $form->field(name => "email", size => 50, fieldset => "preferences"); $form->field(name => "subscriptions", size => 50, fieldset => "preferences", - comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")"); + comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")"); $form->field(name => "banned_users", size => 50, fieldset => "admin"); @@ -335,7 +335,8 @@ sub cgi_editpage ($$) { #{{{ # characters. my ($page)=$form->field('page'); $page=titlepage(possibly_foolish_untaint($page)); - if (! defined $page || ! length $page || file_pruned($page, $config{srcdir}) || $page=~/^\//) { + if (! defined $page || ! length $page || + file_pruned($page, $config{srcdir}) || $page=~/^\//) { error("bad page name"); } @@ -385,7 +386,9 @@ sub cgi_editpage ($$) { #{{{ $form->tmpl_param("can_commit", $config{rcs}); $form->tmpl_param("indexlink", indexlink()); $form->tmpl_param("helponformattinglink", - htmllink("", "", "HelpOnFormatting", noimageinline => 1)); + htmllink("", "", "ikiwiki/formatting", + noimageinline => 1, + linktext => "FormattingHelp")); $form->tmpl_param("baseurl", baseurl()); if ($form->submitted eq "Cancel") { @@ -505,6 +508,7 @@ sub cgi_editpage ($$) { #{{{ } showform($form, \@buttons, $session, $q); + saveindex(); } else { # save page @@ -512,8 +516,8 @@ sub cgi_editpage ($$) { #{{{ my $exists=-e "$config{srcdir}/$file"; - if ($form->field("do") ne "create" && - ! $exists && ! -e "$config{underlaydir}/$file") { + if ($form->field("do") ne "create" && ! $exists && + ! eval { srcfile($file) }) { $form->tmpl_param("page_gone", 1); $form->field(name => "do", value => "create", force => 1); $form->tmpl_param("page_select", 0); @@ -594,6 +598,10 @@ sub cgi_editpage ($$) { #{{{ # may have been committed while the post-commit hook was # disabled. require IkiWiki::Render; + # Reload index, since the first time it's loaded is before + # the wiki is locked, and things may have changed in the + # meantime. + loadindex(); refresh(); saveindex();