function ViewsConfigUpdater::processFieldHandlerWithFormatPlural

Processes fields with the format plural option set.

This option is only set for fields using an aggregation function such as COUNT or SUM. The data type is changed so it matches the field schema.

Parameters

array $handler: A display handler.

string $handler_type: The handler type.

Return value

bool Whether the handler was updated.

1 call to ViewsConfigUpdater::processFieldHandlerWithFormatPlural()
ViewsConfigUpdater::needsFormatPluralUpdate in core/modules/views/src/ViewsConfigUpdater.php
Checks for fields with the format plural option set.

File

core/modules/views/src/ViewsConfigUpdater.php, line 246

Class

ViewsConfigUpdater
Provides a BC layer for modules providing old configurations.

Namespace

Drupal\views

Code

protected function processFieldHandlerWithFormatPlural(array &$handler, string $handler_type) : bool {
  // Force view re-save if the format plural option exists.
  if ($handler_type === 'field' && isset($handler['format_plural'])) {
    // Cast to the correct data type. This changes 1/0 to true/false.
    $handler['format_plural'] = (bool) $handler['format_plural'];
    return TRUE;
  }
  return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.