00601: empty pagelists not XHTML compliant

Summary: empty pagelists not XHTML compliant
Created: 2005-11-19 07:15
Status: Closed - fixed for 2.1.beta10
Category: Bug
Priority: 2
Version: 2.0.12


While checking my XHTML compliance, I noticed that empty lists from a pagelist directive still outputs <dl ...></dl> (empty list) which is not valid XHTML...

May i propose modifying pagelist.php like so:

--- pagelist.php.orig       2005-11-15 10:12:22.077808350 +0100
+++ pagelist.php        2005-11-15 10:20:10.164580960 +0100
@@ -243,6 +243,7 @@
    SDV($FPLByGroupIFmt,"<dd><a href='\$PageUrl'>\$Name</a></dd>\n");
    SDVA($FPLByGroupOpt, array('readf' => 0, 'order' => 'name'));
    $matches = MakePageList($pagename, array_merge((array)$FPLByGroupOpt, $opt));
+   if(!count($matches)) return "";
    if (@$opt['count']) array_splice($matches, $opt['count']);
    $out = array();
    foreach($matches as $pc) {

I'm not a PHP programmer (but I'm learning quickly with pmwiki...) so there might be better ways, but it seems to work for me. There are of course similar cases in the other formatting functions, this was just for ByGroup cases.