Skip to content

Commit

Permalink
MDL-45724 cache: fixed warning structure bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jul 23, 2014
1 parent 919dc29 commit ed2de2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion cache/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@
}
}

$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);
Expand Down
6 changes: 1 addition & 5 deletions cache/classes/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,7 @@ public static function initialise_unit_test_instance(cache_definition $definitio
* 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();
Expand Down
2 changes: 1 addition & 1 deletion cache/stores/memcache/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public function get_warnings() {
$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;
}
Expand Down

0 comments on commit ed2de2e

Please sign in to comment.