MDL-45724 cache: fixed warning structure bug

This commit is contained in:
Sam Hemelryk 2014-07-23 15:16:20 +12:00
parent 919dc292b9
commit ed2de2ecc7
3 changed files with 7 additions and 7 deletions

6
cache/admin.php vendored
View File

@ -280,7 +280,11 @@ if (!empty($action) && confirm_sesskey()) {
}
}
$notifications = array_merge($notifications, cache_helper::warnings($stores));
// Add cache store warnings to the list of notifications.
// Obviously as these are warnings they are show as failures.
foreach (cache_helper::warnings($stores) as $warning) {
$notifications[] = array($warning, false);
}
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);

View File

@ -372,11 +372,7 @@ abstract class cache_store implements cache_store_interface {
* This should be used to notify things like configuration conflicts etc.
* The warnings returned here will be displayed on the cache configuration screen.
*
* @return array[] Returns an array of arrays with the format:
* $notifications = array(
* array('This is a success message', true),
* array('This is a failure message', false),
* );
* @return string[] An array of warning strings from the store instance.
*/
public function get_warnings() {
return array();

View File

@ -589,7 +589,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
$host = array_shift($bits);
$port = (count($bits)) ? array_shift($bits) : '11211';
foreach ($this->servers as $server) {
if ($server[0] === $host && $server[1] === $port) {
if ($server[0] === $host && $server[1] == $port) {
$warnings[] = get_string('sessionhandlerconflict', 'cachestore_memcache', $this->my_name());
break;
}