dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc151d5
)
allow Category objects for empty categories
author
Daniel Kinzler
<daniel@users.mediawiki.org>
Tue, 1 Jul 2008 20:49:23 +0000
(20:49 +0000)
committer
Daniel Kinzler
<daniel@users.mediawiki.org>
Tue, 1 Jul 2008 20:49:23 +0000
(20:49 +0000)
includes/Category.php
patch
|
blob
|
history
diff --git
a/includes/Category.php
b/includes/Category.php
index
4386491
..
45d2afa
100644
(file)
--- a/
includes/Category.php
+++ b/
includes/Category.php
@@
-46,7
+46,18
@@
class Category {
);
if( !$row ) {
# Okay, there were no contents. Nothing to initialize.
- return false;
+ if ( $this->mTitle ) {
+ # If there is a title object but no record in the category table, treat this as an empty category
+ $this->mID = false;
+ $this->mName = $this->mTitle->getDBKey();
+ $this->mPages = 0;
+ $this->mSubcats = 0;
+ $this->mFiles = 0;
+
+ return true;
+ } else {
+ return false; # Fail
+ }
}
$this->mID = $row->cat_id;
$this->mName = $row->cat_title;