Upgrade to 3.6.6

This commit is contained in:
Bastian Allgeier
2022-05-05 13:58:33 +02:00
parent 5c64df9e2b
commit d515908e2e
12 changed files with 190 additions and 24 deletions

View File

@@ -289,13 +289,16 @@ class Blueprint
$file = $kirby->extension('blueprints', $name);
}
// callback option can be return array or blueprint file path
if (is_callable($file) === true) {
$file = $file($kirby);
}
// now ensure that we always return the data array
if (is_string($file) === true && F::exists($file) === true) {
return static::$loaded[$name] = Data::read($file);
} elseif (is_array($file) === true) {
return static::$loaded[$name] = $file;
} elseif (is_callable($file) === true) {
return static::$loaded[$name] = $file($kirby);
}
// neither a valid file nor array data