Skip to content

Commit

Permalink
minor #5549 Allow to have empty page titles (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.x branch.

Discussion
----------

Allow to have empty page titles

Fixes #5545.

The proposed behavior (`null` === use the default title; `(empty string)` === don't show any title) fits well with the behavior of the rest of features of this bundle.

As `@Lustmored` said, the only issue is that you'll see a new "missing translation" for the empty string:

<img width="964" alt="missing-translation" src="https://user-images.githubusercontent.com/73419/209708276-2c321204-4e7b-40c6-9386-0779a7ac4bf7.png">

I think someone could send a PR to Symfony to "fix" this and to simply output an empty string when "translating" an empty string.

Commits
-------

27ed94e Allow to have empty page titles
  • Loading branch information
javiereguiluz committed Dec 30, 2022
2 parents e7c5597 + 27ed94e commit e8210bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dto/CrudDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getCustomPageTitle(string $pageName = null, $entityInstance = nu
$title = null !== $entityInstance ? $title($entityInstance) : $title();
}

if (null === $title || '' === $title) {
if (null === $title) {
return null;
}

Expand Down

0 comments on commit e8210bc

Please sign in to comment.