Upgrade to 3.9.1

This commit is contained in:
Bastian Allgeier
2023-01-31 11:10:44 +01:00
parent 6e5c9d1f48
commit c58864a585
54 changed files with 633 additions and 465 deletions

View File

@@ -153,11 +153,14 @@ class Snippet extends Tpl
* or the template string for self-enclosed snippets
*/
public static function factory(
string|array $name,
string|array|null $name,
array $data = [],
bool $slots = false
): static|string {
$file = static::file($name);
// instead of returning empty string when `$name` is null
// allow rest of code to run, otherwise the wrong snippet would be closed
// and potential issues for nested snippets may occur
$file = $name !== null ? static::file($name) : null;
// for snippets with slots, make sure to open a new
// snippet and start capturing slots
@@ -309,7 +312,7 @@ class Snippet extends Tpl
array_key_exists('slot', $data) === true ||
array_key_exists('slots', $data) === true
) {
Helpers::deprecated('Passing the $slot or $slots variables to snippets is deprecated and will break in Kirby 3.10.');
Helpers::deprecated('Passing the $slot or $slots variables to snippets is deprecated and will break in a future version.', 'snippet-pass-slots');
}
// @codeCoverageIgnoreEnd