Skip to content
Snippets Groups Projects

Issue #3430516 by olmyr: Automated Drupal 11 compatibility fixes for field_limiter

3 files
+ 9
9
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -57,7 +57,7 @@ class FieldLimiter extends FieldWrapperBase {
'#default_value' => $this->getSetting('offset'),
'#required' => TRUE,
'#min' => 0,
'#description' => $this->t('Number of items to skip from the beginning.')
'#description' => $this->t('Number of items to skip from the beginning.'),
];
$form['limit'] = [
@@ -66,11 +66,11 @@ class FieldLimiter extends FieldWrapperBase {
'#default_value' => $this->getSetting('limit'),
'#required' => TRUE,
'#min' => 0,
'#description' => $this->t('Number of items to display. Set to 0 to display all items.')
'#description' => $this->t('Number of items to display. Set to 0 to display all items.'),
];
return $form;
}
}
/**
* {@inheritdoc}
@@ -82,14 +82,14 @@ class FieldLimiter extends FieldWrapperBase {
$limit = $this->getSetting('limit');
if ($limit == 0) {
$summary[] = $this->t('Showing all values, starting at @offset.', array(
$summary[] = $this->t('Showing all values, starting at @offset.', [
'@offset' => $offset,
));
]);
}
else {
$summary[] = $this->formatPlural($limit, 'Limited to 1 value, starting at @offset.', 'Limited to @count values, starting at @offset.', array(
$summary[] = $this->formatPlural($limit, 'Limited to 1 value, starting at @offset.', 'Limited to @count values, starting at @offset.', [
'@offset' => $offset,
));
]);
}
return $summary;
Loading