-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.4.7 Empty headline is still output in the template #166
Comments
I was debugging this for the past few minutes and this is because $this->headline is now of type Stringable and not empty in if-clauses anymore. This is being caused in the last change: contao-rocksolid-custom-elements/src/Element/CustomElement.php Lines 301 to 315 in c69bf39
The question is if this should be fixed from your side @ausi or if every person using custom-elements would need to update their templates after updating to version 2.4.7. We'd all either need to use I consider this critical since updates would lead to something that may output empty headlines like here:
A possible solution would be using the ParseTemplateListener as it only renders html templates namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\Template;
#[AsHook('parseTemplate')]
class ParseTemplateListener
{
public function __invoke(Template $template): void
{
// Cast stringable to string (See #166)
$template->headline = (string) $template->headline;
}
} |
@Ainschy can you please try if the latest |
Thanks it's look fine for me |
Contao 4.13.37 PHP8.2
Since 2.4.7 empty headlines are displayed in the frontend despite a query in the template.
The text was updated successfully, but these errors were encountered: