(bug 20837) Don't give a PHP notice when getSubitem() calls loadSubitem() which causes the whole item to be loaded. In this case there is no negative cache value stored so we need to use isset(). It was handled already for the case where the item was already loaded at function entry, but not for the case where the item is loaded halfway through loadSubitem().
This commit is contained in:
parent
ddd5acf900
commit
33ce9783f5
1 changed files with 11 additions and 13 deletions
|
|
@ -218,20 +218,18 @@ class LocalisationCache {
|
|||
if ( isset( $this->legacyData[$code][$key][$subkey] ) ) {
|
||||
return $this->legacyData[$code][$key][$subkey];
|
||||
}
|
||||
if ( !isset( $this->loadedSubitems[$code][$key][$subkey] ) ) {
|
||||
if ( isset( $this->loadedItems[$code][$key] ) ) {
|
||||
if ( isset( $this->data[$code][$key][$subkey] ) ) {
|
||||
return $this->data[$code][$key][$subkey];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
wfProfileIn( __METHOD__.'-load' );
|
||||
$this->loadSubitem( $code, $key, $subkey );
|
||||
wfProfileOut( __METHOD__.'-load' );
|
||||
}
|
||||
if ( !isset( $this->loadedSubitems[$code][$key][$subkey] )
|
||||
&& !isset( $this->loadedItems[$code][$key] ) )
|
||||
{
|
||||
wfProfileIn( __METHOD__.'-load' );
|
||||
$this->loadSubitem( $code, $key, $subkey );
|
||||
wfProfileOut( __METHOD__.'-load' );
|
||||
}
|
||||
if ( isset( $this->data[$code][$key][$subkey] ) ) {
|
||||
return $this->data[$code][$key][$subkey];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return $this->data[$code][$key][$subkey];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue