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

Issue fork memcache-3463194

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

janusman created an issue. See original summary.

shawn dearmond’s picture

I'm seeing this as well.

japerry made their first commit to this issue’s fork.

janusman’s picture

Status: Active » Reviewed & tested by the community

MR looks good! My http://MYSITE/admin/reports/memcache page went from throwing PHP fatals to showing actual results.

  • japerry committed b1b8f738 on 8.x-2.x
    Issue #3463194: memcache_admin fails for multi-server clusters when no '...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Awesome! Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.