diff -u b/src/Entity/Paragraph.php b/src/Entity/Paragraph.php --- b/src/Entity/Paragraph.php +++ b/src/Entity/Paragraph.php @@ -502,7 +502,7 @@ * Gets the number of summaries. * * @return int - * The number of summaries. Can be 0. + * The number of summaries. */ protected function getSummaryCount() { if ($this->summaryCount !== NULL) { @@ -587,6 +587,13 @@ } } + // Checks if it is an empty nested paragraph. + if ($summary_count === 0) { + $paragraph_summary = 'Empty paragraph'; + $paragraph_summary .= !empty($summary) ? ' | ' . implode(', ', $summary) : ''; + return t('@summary', ['@summary' => $paragraph_summary]); + } + if (isset($options['count_limit']) && $summary_count > $options['count_limit']) { return t('More then @count_limit children @summary', [ '@count_limit' => $options['count_limit'], @@ -594,13 +601,6 @@ ]); } - // Checks if it is an empty nested paragraph. - if ($summary_count === 0) { - $paragraph_summary = 'Empty paragraph'; - $paragraph_summary .= !empty($summary) ? ' | ' . $summary : ''; - return t('@summary', ['@summary' => $paragraph_summary]); - } - return \Drupal::translation() ->formatPlural($summary_count, '1 child | @summary', '@count children | @summary', [ '@count' => $summary_count,