]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/comments.pm
factored out an urlabs from aggregate and cgi
[git.ikiwiki.info.git] / IkiWiki / Plugin / comments.pm
index 68ac4cfae4844dd7de3b44e7af9956d00ab3ac75..cdb9262710bd4f86ef4ded3e36833331dcce9d82 100644 (file)
@@ -237,7 +237,7 @@ sub preprocess {
        }
 
        if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
-               $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page})).
+               $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page}), undef, 1).
                        "#".page_to_id($params{page});
        }
 
@@ -372,10 +372,8 @@ sub editcomment ($$) {
                error(gettext("bad page name"));
        }
 
-       my $baseurl = urlto($page);
-
        $form->title(sprintf(gettext("commenting on %s"),
-                       IkiWiki::pagetitle($page)));
+                       IkiWiki::pagetitle(IkiWiki::basename($page))));
 
        $form->tmpl_param('helponformattinglink',
                htmllink($page, $page, 'ikiwiki/formatting',
@@ -385,7 +383,7 @@ sub editcomment ($$) {
 
        if ($form->submitted eq CANCEL) {
                # bounce back to the page they wanted to comment on, and exit.
-               IkiWiki::redirect($cgi, $baseurl);
+               IkiWiki::redirect($cgi, urlto($page));
                exit;
        }
 
@@ -556,8 +554,8 @@ sub editcomment ($$) {
 
        }
        else {
-               IkiWiki::showform ($form, \@buttons, $session, $cgi,
-                       forcebaseurl => $baseurl, page => $page);
+               IkiWiki::showform_preview($form, \@buttons, $session, $cgi,
+                       page => $page);
        }
 
        exit;