Index: /home/alain/workspaces/workspace-dotclear/dc2/inc/core/class.dc.blog.php =================================================================== --- /home/alain/workspaces/workspace-dotclear/dc2/inc/core/class.dc.blog.php (revision 2650) +++ /home/alain/workspaces/workspace-dotclear/dc2/inc/core/class.dc.blog.php (working copy) @@ -235,6 +235,7 @@ - cat_id: filter on cat_id field - start: start with a given category - level: categories level to retrieve + - without_empty: filter empty categories @param params array Parameters @return record @@ -248,7 +249,7 @@ } $counter = $this->getCategoriesCounter($c_params); - $without_empty = $this->core->auth->userID() == false; # For public display + $without_empty = isset($params['without_empty']) ? (bool) $params['without_empty'] : ($this->core->auth->userID() == false); $start = isset($params['start']) ? (integer) $params['start'] : 0; $l = isset($params['level']) ? (integer) $params['level'] : 0; Index: /home/alain/workspaces/workspace-dotclear/dc2/inc/public/lib.urlhandlers.php =================================================================== --- /home/alain/workspaces/workspace-dotclear/dc2/inc/public/lib.urlhandlers.php (revision 2650) +++ /home/alain/workspaces/workspace-dotclear/dc2/inc/public/lib.urlhandlers.php (working copy) @@ -146,18 +146,15 @@ $params['cat_url'] = $args; $params['post_type'] = 'post'; + $params['without_empty'] = false; $_ctx->categories = $core->blog->getCategories($params); - if ($_ctx->categories->isEmpty()) { - self::p404(); - } else { - if ($n) { - $GLOBALS['_page_number'] = $n; - } - self::serveDocument('category.html'); - exit; + if ($n) { + $GLOBALS['_page_number'] = $n; } + self::serveDocument('category.html'); + exit; } public static function archive($args) Index: /home/alain/workspaces/workspace-dotclear/dc2/plugins/widgets/_widgets_functions.php =================================================================== --- /home/alain/workspaces/workspace-dotclear/dc2/plugins/widgets/_widgets_functions.php (revision 2650) +++ /home/alain/workspaces/workspace-dotclear/dc2/plugins/widgets/_widgets_functions.php (working copy) @@ -60,7 +60,7 @@ { global $core, $_ctx; - $rs = $core->blog->getCategories(array('post_type'=>'post')); + $rs = $core->blog->getCategories(array('post_type'=>'post', 'without_empty' => false)); if ($rs->isEmpty()) { return; }