podlove-publisher icon indicating copy to clipboard operation
podlove-publisher copied to clipboard

TypeError when empty templates are called

Open pgerstbach opened this issue 4 years ago • 0 comments

Expected behavior

I have configured an empty twig template "default" that I don't use anymore. But a shortcode with it is present in some older episodes and I haven't removed them yet. Some time ago this empty template was called, but rendered empty, as expected.

Actual behavior

Since my latest update an exception is thrown, when a template is empty:

Ein Fehler vom Typ E_ERROR wurde in der Zeile 30 der Datei /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/vendor/twig/twig/src/Source.php verursacht. Fehlermeldung: Uncaught TypeError: Argument 1 passed to Twig\Source::__construct() must be of the type string, null given, called in /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/lib/template/twig_loader_podlove_database.php on line 21 and defined in /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/vendor/twig/twig/src/Source.php:30 Stack trace: #0 /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/lib/template/twig_loader_podlove_database.php(21): Twig\Source->__construct(NULL, 'default', '') #1 /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/vendor/twig/twig/src/Loader/ChainLoader.php(59): Podlove\Template\TwigLoaderPodloveDatabase->getSourceContext('default') #2 /wp-content/plugins/podlove-podcasting-plugin-for-wordpress/vendor/twig/twig/src/Environment.php(407): Twig\Loader\ChainLoader->getSourceCo

I have now added a blank to the template " " and the error is gone. But I think an empty template should not cause an error that fails to render the whole page.

System information

PHP Version 7.4.3 WordPress Version 5.5.1 Publisher Version 3.0.4 Web Player Version player_v5 Twig Version 2.12.5

pgerstbach avatar Oct 09 '20 19:10 pgerstbach