Skip to content

Commit

Permalink
Fix for rebuilding list-format with incomplete (outdated) Records in …
Browse files Browse the repository at this point in the history
…the DB
  • Loading branch information
bobdenotter committed Sep 26, 2023
1 parent 14fe437 commit 22d81c4
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 22d81c4

Please sign in to comment.