Some pagelist sort orders are not working on pmwiki.org:

* random, size, time, ctime, title

I suggest the attached change to scripts/pagelist.php.


Chuck G

--- pagelist.php        2017-11-14 04:01:53.000000000 -0600
+++ pagelist-cg.php     2017-11-14 23:48:17.199006843 -0600
@@ -504,13 +504,13 @@
     { NoCache(); foreach($list as $pn) $PCache[$pn]['random'] = rand(); }
   foreach(preg_grep('/^\\$/', array_keys($order)) as $o) 
     foreach($list as $pn) 
       $PCache[$pn][$o] = PageVar($pn, $o);
   foreach($PageListSortCmp as $o=>$f)
     if(! is_callable($f)) # DEPRECATED
-      $PageListSortCmp[$o] = create_function('$x,$y', "return {$f};");
+      $PageListSortCmp[$o] = create_function('$x,$y', "global \$PCache; return 
{$f};");
 
   StopWatch('PageListSort sort');
   if (count($opt['=order'])) {
     $PCache['=pagelistoptorder'] = $opt['=order'];
     uasort($list, 'PageListUASort');
   }
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to