00165: [[PageName&variable=value]] not supported

Summary: [[PageName&variable=value]] not supported
Created: 2004-11-17 22:09
Status: Closed - fixed
Category: Feature
From: jr
Assigned:
Priority: 3
Version: 2.0 dev 22
OS: all

Description: The Cookbook/WikiCalendar includes a configuration setting to control how next and previous calendar period links render. By default, it creates links of the form [[HomePage?logdate=yyyymm | Month yyyy]]. However, if the wiki uses addresses of the form ?pagename=Group.Page, this doesn't work. Instead, the calendar tries, and currently fails, to create links of the form [[HomePage&logdate=yyyymm | Month yyyy]].

This works correctly with the following changes to pmwiki.php ([?#] becomes [?#&]):

 
  $QueryFragPattern = "[?#&][^\\s$UrlExcludeChars]*";
                          ^ add &
  ...
  function LinkPage( ...
    ...
    if (!preg_match("/^([^#?&]+)($QueryFragPattern)?$/",$path,$match))
                            ^ add &
 

There may be another way to solve this, but the above is a quick fix that seems to work. In PmWiki 1, the calendar script uses ThisPage: markup, which supports a following & character.


The fix is to always use ?logdate=yyyymm. PmWiki knows how to handle this internally, even if the site is using ?pagename=... links. Feel free to close this issue if this works for you. --Pm

This didn't work for the person who reported the problem to me. The calendar uses ?logdate=yyyymm by default and I verified that the forward and back links didn't work. The only way we could make it work was with the fix described above. jr

I think I found the problem. PmWiki correctly sets the $_GET array in the presence of extra '?'s in the QUERY_STRING, but it wasn't setting $_REQUEST. Thus a script making use of $_REQUEST instead of $_GET wouldn't see the corrected variables.

I've fixed PmWiki (2.0.beta4) to now update $_REQUEST as well as $_GET, so maybe this fixes things?

Ah. The code was using $HTTP_GET_VARS['logdate'] -- I have changed it to $_GET and we'll see whether that fixes the problem. And it seems to have done so!