Commit 3eada0d9 authored by Nia Kathoni's avatar Nia Kathoni Committed by Daniel Cothran
Browse files

Issue #3278272 by nikathone: Update causes error: count(): Parameter must be...

Issue #3278272 by nikathone: Update causes error:  count(): Parameter must be an array or an object that implements Countable charts.post_update.php:30
parent a47b14ae
Loading
Loading
Loading
Loading
+1 −1
Changes for charts.post_update.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ function charts_post_update_existing_default_colors_to_twenty_five(&$sandbox) {
  $config = \Drupal::service('config.factory')->getEditable('charts.settings');
  $existing_colors = $config->get('charts_default_settings.display.colors');

  if (count($existing_colors) === 10) {
  if (is_countable($existing_colors) && count($existing_colors) === 10) {
    $path = \Drupal::service('extension.list.module')->getPath('charts');
    $default_install_settings_file = $path . '/config/install/charts.settings.yml';
    if (!file_exists($default_install_settings_file)) {