Printer Friendly Bug in Wikidot OS rev 393

0 views
Skip to first unread message

Ed Johnson

unread,
Dec 30, 2008, 1:18:30 PM12/30/08
to temporary wikidot dev-list
I may have found a small problem with rev 393. One of my users tried
to print a page using the "print" link at the bottom of the page and
the URL was rendered incorrectly:

http://daopman.davanniswiki.com/printer--friendly//opman:bankproc
(double slashes in front of the page to print)
The page that was rendered in the printer friendly window was the root
of my site (the start page).

Copying and pasting the correctly formatted URL:
http://daopman.davanniswiki.com/printer--friendly/opman:bankproc
renders the page as expected.

This may be related to the conversion I just completed with some old
code still affecting things (http://my-wd-local.wikidot.com/
blog:dawiki-upgrade-is-live).

If this is a bug, can you tell which file to edit to fix this?

Thanks,
Ed

Ed Johnson

unread,
Dec 30, 2008, 2:51:21 PM12/30/08
to temporary wikidot dev-list
I found the javascript file to edit and fix this. I may have placed
old files from ../file--common/.. into the new revision that caused
this to break. I won't be able to verify this until later tonight.

-Ed

Ed Johnson

unread,
Dec 30, 2008, 6:09:36 PM12/30/08
to temporary wikidot dev-list
OK, I did confirm this is an issue with rev 393. I have a "clean"
install running on my VM (not upgraded from any prior revisions) and
clicking the "print" link at the bottom of any page results in an
incorrectly rendered URL. For example:
http://www.mywikidot.com/printer--friendly//mywikidot-info

The fix is to remove the trailing "/" from var url = '/printer-
friendly/'" in the file web/files--common/javascript/WIKIDOT.page.js.
=============== Broken code: =================
[[code]]
printClick: function(e){
// open a new window...
var url = '/printer--friendly/'+window.location.pathname;
[[/code]]
=============== Fixed code: =================
[[code]]
printClick: function(e){
// open a new window...
var url = '/printer--friendly'+window.location.pathname;
[[/code]]

I am confused though. I noticed that Wikidot.com renders the URL
"incorrectly" with the "//" in front of the page names, but it
displays the correct page in the printer friendly window. Is there
something else happening with my open source configuration?

Wikidot.com displays the correct printer friendly content with either
form of the URL. For example,
http://community.wikidot.com/printer--friendly//forum/t-116363/content-displayed-in-rss-feeds
and
http://community.wikidot.com/printer--friendly/forum/t-116363/content-displayed-in-rss-feeds
both display the correct content.

-Ed

Piotr Gabryjeluk

unread,
Dec 31, 2008, 4:50:47 AM12/31/08
to wik...@googlegroups.com
I believe we had similar bug in Wikidot.com and we fixed it there. It's
the lighttpd-wikidot.conf file that needs to be fixed (i.e. to accept
also double slashes in printer friendly URLs.

I'll fix this when I have some time.

Dnia 2008-12-30, o godz. 10:18:30
Ed Johnson <edjohn...@gmail.com> napisał(a):
--
Piotr Gabryjeluk
Wikidot.com developer
http://piotr.gabryjeluk.pl/

Piotr Gabryjeluk

unread,
Dec 31, 2008, 4:51:38 AM12/31/08
to wik...@googlegroups.com
This is also a kind of solution. Thank you!

Dnia 2008-12-30, o godz. 15:09:36
Ed Johnson <edjohn...@gmail.com> napisał(a):
Reply all
Reply to author
Forward
0 new messages