PDA

View Full Version : wiki.PageExists against page titles containing commas


mhoydis
06-12-2008, 07:20 PM
Hi. I'm trying to get wiki.pageexists to evaluate to TRUE. However, I cannot get it to work against pages I have which contain commas in the title. Also spaces.

I have a bunch of pages with titles similar to this...
/Shift Notes/2008-06-12, Thursday, Second Shift
URL looks like... http://hostname/Shift_Notes/2008-06-12%2c_Thursday%2c_Second_Shift

I've tried every variation of that title I can think of, but wiki.pageexists always evaluates to FALSE. I've tried it with underscores, using %2c for the commas, with a slash in front, trailing slash, and all combinations of those ideas.

Can someone help me out with the syntax trick to get this to work? I'm at my wits end on this one :( I bet it's something silly.


Ideally, when I figure this out in a static fashion, I want to do something like this...
wiki.pageexists(page.path.."/"..date.year(date.now).."-"..date.month(date.now).."-"..date.day(date.now)..", "..date.dayname(date.now)..", Second Shift")

merktnichts
06-12-2008, 08:11 PM
See this tracking item: http://bugs.developer.mindtouch.com/view.php?id=4293

mhoydis
06-12-2008, 08:17 PM
Thanks, but that's assuredly bogus. I can definitely get wiki.pageexists to evaluate to true in 8.05.1

Granted, I've only so far successfully gotten that to work against top-level pages. Maybe that's the bug. Maybe the bug is non-top-level pages.

mhoydis
06-12-2008, 08:43 PM
I got this to work.

SEEMINGLY... the issue is that page.path returns the page title with a space in it. However, I was only able to get wiki.pageexists to work if I replaced the spaces with underscores.
So, seemingly, page.path is currently not compatible with wiki.pageexists.
Seemingly.

merktnichts
06-12-2008, 08:45 PM
Okay, that could be why I wasn't able to make it work (thus the bug ticket). And even the doc demo (http://wiki.developer.mindtouch.com/MindTouch_Deki/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.PageExists) shows there's something wrong here. At least the second example should return true.

You might wanna add your information to the bug ticket, maybe it helps Steve to iron it out.

SteveB
06-12-2008, 11:53 PM
That would be nice! :)