1 I really like the new approach to having only one main template "page.tmpl". For instance, it improves previews during edits.
2 But it causes some nasty bugs for plugins that use the pagetemplate hook. It is especially visible with the [[plugins/sidebar]] plugin.
8 * activate sidebars globally and cgi
9 * create "/sidebar.mdwn" with "[<span></span>[foo]]" inside
10 * create "/foo.mdwn" with "hello!" inside
13 * with the web browser, go to the page "bar"
14 * notice the sidebar, click on "foo"
15 * notice the page "foo" is now displayed (hello!)
16 * return the the page "bar" and click "edit"
17 * notice the sidebar is still here, click on the "foo"
18 * -> Problem: 404, the browser goes to "/bar/foo"
19 * -> Was expected: the browser goes to "/foo"
23 * create "/bar/sidebar.mdwn" with "world"
25 * with the web browser, go to the page "bar"
26 * notice the sidebar displays "world"
28 * -> Problem: the sidebar now shows the foo link (it is the root sidebar!)
29 * -> Was expecte : the sidebar displays "world"
33 * with the web browser edit the page "bar"
34 * type <code>[<span></span>[!sidebar content="goodby"]]</code>
36 * -> Problem: the sidebar still displays the foo link
37 * -> Was expected: the sidebar display "goodby"
39 ## Some superficial hacking
41 With the following workaround hacks, I manage to solve the 3 examples shown above:
43 1- edit IkiWiki/Plugin/editpage.pm and call showform with additional page and destpage parameters:
44 <pre>showform($form, \@buttons, $session, $q, forcebaseurl => $baseurl, page => $page, destpage => $page);</pre>
46 2- edit /usr/share/perl5/IkiWiki.pm and modify the misctemplate function to use the given page and destpage:
48 shift->(page => $params{page}, destpage => $params{destpage}, template => $template);</pre>
50 I do not guarantee (I do not even expect) that it is the proper way to solve this bug but it may help developers to find and solve the real problem.