mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 02:16:56 +02:00
Fix blueprints loading (regression from #38)
This commit is contained in:
@@ -37,6 +37,7 @@ class Blueprints
|
||||
public function get($type)
|
||||
{
|
||||
if (!isset($this->instances[$type])) {
|
||||
$parents = [];
|
||||
if (is_string($this->search)) {
|
||||
$filename = $this->search . $type . YAML_EXT;
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ class Plugins extends Iterator
|
||||
|
||||
public static function get($name)
|
||||
{
|
||||
$blueprints = new Blueprints("plugins://{$name}");
|
||||
$blueprint = $blueprints->get('blueprints');
|
||||
$blueprints = new Blueprints('plugins://');
|
||||
$blueprint = $blueprints->get("{$name}/blueprints");
|
||||
$blueprint->name = $name;
|
||||
|
||||
// Load default configuration.
|
||||
|
||||
@@ -90,8 +90,8 @@ class Themes extends Iterator
|
||||
throw new \RuntimeException('Theme name not provided.');
|
||||
}
|
||||
|
||||
$blueprints = new Blueprints("themes://{$name}");
|
||||
$blueprint = $blueprints->get('blueprints');
|
||||
$blueprints = new Blueprints('themes://');
|
||||
$blueprint = $blueprints->get("{$name}/blueprints");
|
||||
$blueprint->name = $name;
|
||||
|
||||
// Find thumbnail.
|
||||
|
||||
@@ -32,8 +32,8 @@ class User extends Data
|
||||
$locator = self::getGrav()['locator'];
|
||||
|
||||
// TODO: validate directory name
|
||||
$blueprints = new Blueprints('blueprints://user');
|
||||
$blueprint = $blueprints->get('account');
|
||||
$blueprints = new Blueprints('blueprints://');
|
||||
$blueprint = $blueprints->get('user/account');
|
||||
$file_path = $locator->findResource('account://' . $username . YAML_EXT);
|
||||
$file = CompiledYamlFile::instance($file_path);
|
||||
$content = $file->content();
|
||||
|
||||
Reference in New Issue
Block a user