Skip to content

Commit

Permalink
Merge pull request #3483 from bolt/fix/rebuild-list-format
Browse files Browse the repository at this point in the history
Fix for rebuilding list-format with incomplete (outdated) Records in the DB
  • Loading branch information
bobdenotter authored Sep 26, 2023
2 parents 14fe437 + 22d81c4 commit fbaf5ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Configuration/Content/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function factory(?string $name, Collection $contentTypesConfig): s
'slug' => $name,
'singular_slug' => $name,
'singular_name' => $name,
'locales' => [],
'locales' => new Collection(),
'fields' => new Collection(),
// when it is created on the fly
'virtual' => true,
Expand Down
3 changes: 2 additions & 1 deletion src/Twig/ContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ public function getExcerpt($content, int $length = 280, bool $includeTitle = fal

public function getListFormat($content)
{
$listFormat = $this->contentHelper->get($content, $content->getDefinition()->get('list_format'));
$format = $content->getDefinition()->get('list_format', '[{contenttype} Nº {id} - {status}] {title}');
$listFormat = $this->contentHelper->get($content, $format);

return $listFormat;
}
Expand Down

0 comments on commit fbaf5ff

Please sign in to comment.