memcache_admin fails for multi-server clusters when no 'bins' settings defined

Created on 22 July 2024, 8 months ago
Updated 28 August 2024, 6 months ago

Problem/Motivation

When using settings that specify multiple servers per cluster, but do not specify the 'bins' setting, we get this error:

Uncaught PHP Exception TypeError: "sort(): Argument #1 ($array) must be of type array, null given" at /PATH/TO/docroot/modules/contrib/memcache/memcache_admin/src/Controller/MemcacheStatisticsController.php line 177

Steps to reproduce

Set the memcache settings to this in settings.php

$conf['memcache_servers'] = ['127.0.0.1:11211' => 'default', 'localhost:11211' => 'default'];

Enable the memcache_admin module and go to http://MYSITE/admin/reports/memcache

Proposed resolution

Not sure yet. Possibly MemcacheStatisticsController.php needs to be fixed, so that this if() statement:

      if (isset($bins_settings)) {

actually envelops more code, so that when it's false, it wouldn't eventually run the sort() and the rest.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.6

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States janusman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024