[pmwiki-users] New recipe: Fox

marc gmane at auxbuss.com
Tue Dec 19 12:24:18 CST 2006


Hans said...
> Tuesday, December 19, 2006, 3:10:33 PM, marc wrote:
> 
> > Have you tried it on a clean PmWiki install yourself?
> 
> Yes. Latest pmwiki, No recipes except fox.php.
> No special setings, no author or authuser.
> Works okay, both on local Windows XP machine with WAMP server, and on
> hosting service public server (I think they run on Linux).
> Very weird, as you seem to be the only one having  a problem
> with saving pages.

Deleting too.

I've started debugging UpdatePage in spare moments. First, I just 
wrapped some debug stuff around the foreach calls to $EditFunctions [1]. 
The result is below [2].

These show two attempts to delete a comment from Comments (which only 
contained one comment); the first is logged out, the second logged in.

Now, if you compare these two runs (after removing the timestamps). Then 
they are identical. The only difference is that in one case 
$IsPagePosted is true after UpdatePage, while in the other it is false.

So, the question is - probably for Pm - in what circumstances can 
UpdatePage receive identical input, yet produce different results?

> Try and copy the NewPageBox example into a new page:
> 
> '''NewPageBox opens new page in edit mode'''
> If page exists it will jump to target page.
> 
> (:fox box1 #top redirect=1 :)
> (:input text newedit value="Test" size=20:)(:input submit post "New Page":)
> (:foxend box1:)
> 
> '''NewPageBox saves new page with template string inserted'''
> If page exists it will append template string to existing target page.
> 
> (:fox box2 #top redirect=1 :)
> (:input text target value="Test" size=20:)(:input submit post "New Page":)
> (:foxtemplate "'''New Page'''":)
> (:foxend box2:)
> 
> First box does not use UpdatePage function of pmwiki 2.2.0,
> Second one does.

I'll take a look, although I'd like to know what you are seeking here.

-- 
Best,
Marc

[1] added error_logs to UpdatePage

function UpdatePage($pagename, &$page, &$new, $fnlist = NULL) {
  global $EditFunctions, $IsPagePosted;
  if (is_null($fnlist)) $fnlist = $EditFunctions;
  $IsPagePosted = false;
  error_log('Entering UpdatePage');
  error_log('$pageame:'.$pagename);
  error_log('$page:'.print_r($page,true));
  error_log('$new:'.print_r($new,true));
  foreach((array)$fnlist as $fn) {
	  $fn($pagename, $page, $new);
  }
  error_log('Exiting UpdatePage');
  if ($IsPagePosted) error_log('$IsPagePosted=true');
  else error_log('$IsPagePosted=false');
  return $IsPagePosted;
}

[2]

[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] Entering 
UpdatePage, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] 
$pageame:Testing.Comments, referer: http://niff/
~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] $page:Array\n(\n    
[version] => pmwiki-2.2.0-beta17 ordered=1 urlencoded=1\n    [agent] => 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) 
Gecko/20060728 Firefox/1.5.0.6\n    [author] => auxbuss\n    [csum] => 
\n    [ctime] => 1166370453\n    [host] => 192.168.0.1\n    [name] => 
Testing.Comments\n    [rev] => 38\n    [targets] => \n    [text] => 
\n#foxbegin 1166381837a64200b0#[[#fox1]]\n(:div1 class=messagehead:)\n>>
div2 rfloat<< \n(:if expr ( auth admin || author auxbuss ):)
{[foxdelrange button 1166381837a64200b0 {$FullName} ]}(:if:)\n>>div2end
<<\n>>div3 rfloat<<  \n[-17.12.2006 - 18:57-] &nbsp; \n>>div3end
<<\n!!!!!auxbuss\n(:div1end:) \n>>messageitem<< \n'''test'''\n>>
messageitem<<\ntest\n>><<#foxend 1166381837a64200b0#\n    [time] => 
1166550710\n)\n, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] $new:Array\n(\n    
[version] => pmwiki-2.2.0-beta17 ordered=1 urlencoded=1\n    [agent] => 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) 
Gecko/20060728 Firefox/1.5.0.6\n    [author] => auxbuss\n    [csum] => 
\n    [ctime] => 1166370453\n    [host] => 192.168.0.1\n    [name] => 
Testing.Comments\n    [rev] => 38\n    [targets] => \n    [text] => \n    
[time] => 1166550710\n)\n, referer: http://niff/
~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] Exiting 
UpdatePage, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:57:58 2006] [error] [client 192.168.0.1] 
$IsPagePosted=false, referer: http://niff/~marc/Marc/Testing/CommentBox



[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] Entering 
UpdatePage, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] 
$pageame:Testing.Comments, referer: http://niff/
~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] $page:Array\n(\n    
[version] => pmwiki-2.2.0-beta17 ordered=1 urlencoded=1\n    [agent] => 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) 
Gecko/20060728 Firefox/1.5.0.6\n    [author] => auxbuss\n    [csum] => 
\n    [ctime] => 1166370453\n    [host] => 192.168.0.1\n    [name] => 
Testing.Comments\n    [rev] => 38\n    [targets] => \n    [text] => 
\n#foxbegin 1166381837a64200b0#[[#fox1]]\n(:div1 class=messagehead:)\n>>
div2 rfloat<< \n(:if expr ( auth admin || author auxbuss ):)
{[foxdelrange button 1166381837a64200b0 {$FullName} ]}(:if:)\n>>div2end
<<\n>>div3 rfloat<<  \n[-17.12.2006 - 18:57-] &nbsp; \n>>div3end
<<\n!!!!!auxbuss\n(:div1end:) \n>>messageitem<< \n'''test'''\n>>
messageitem<<\ntest\n>><<#foxend 1166381837a64200b0#\n    [time] => 
1166550710\n)\n, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] $new:Array\n(\n    
[version] => pmwiki-2.2.0-beta17 ordered=1 urlencoded=1\n    [agent] => 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) 
Gecko/20060728 Firefox/1.5.0.6\n    [author] => auxbuss\n    [csum] => 
\n    [ctime] => 1166370453\n    [host] => 192.168.0.1\n    [name] => 
Testing.Comments\n    [rev] => 38\n    [targets] => \n    [text] => \n    
[time] => 1166550710\n)\n, referer: http://niff/
~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] Exiting 
UpdatePage, referer: http://niff/~marc/Marc/Testing/CommentBox
[Tue Dec 19 17:58:21 2006] [error] [client 192.168.0.1] 
$IsPagePosted=true, referer: http://niff/~marc/Marc/Testing/CommentBox







More information about the pmwiki-users mailing list