mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed Flex directory configuration creating environment configuration when it should not
This commit is contained in:
parent
26295d5cf2
commit
4519971a76
|
|
@ -22,6 +22,7 @@
|
|||
* Fixed Twig being very slow when template overrides do not exist
|
||||
* Fixed `UserObject::$authorizeCallable` binding to the user object
|
||||
* Fixed `FlexIndex::call()` to return null instead of failing to call undefined method
|
||||
* Fixed Flex directory configuration creating environment configuration when it should not
|
||||
|
||||
# v1.7.25
|
||||
## 11/16/2021
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use Grav\Common\Utils;
|
|||
use Grav\Framework\Cache\Adapter\DoctrineCache;
|
||||
use Grav\Framework\Cache\Adapter\MemoryCache;
|
||||
use Grav\Framework\Cache\CacheInterface;
|
||||
use Grav\Framework\Flex\Interfaces\FlexAuthorizeInterface;
|
||||
use Grav\Framework\Filesystem\Filesystem;
|
||||
use Grav\Framework\Flex\Interfaces\FlexCollectionInterface;
|
||||
use Grav\Framework\Flex\Interfaces\FlexDirectoryInterface;
|
||||
use Grav\Framework\Flex\Interfaces\FlexFormInterface;
|
||||
|
|
@ -218,8 +218,17 @@ class FlexDirectory implements FlexDirectoryInterface
|
|||
|
||||
/** @var UniformResourceLocator $locator */
|
||||
$locator = $grav['locator'];
|
||||
/** @var string $filename Filename is always string */
|
||||
$filename = $locator->findResource($this->getDirectoryConfigUri($name), true, true);
|
||||
|
||||
$filename = $this->getDirectoryConfigUri($name);
|
||||
if (file_exists($filename)) {
|
||||
$filename = $locator->findResource($filename, true);
|
||||
} else {
|
||||
$filesystem = Filesystem::getInstance();
|
||||
$dirname = $filesystem->dirname($filename);
|
||||
$basename = $filesystem->basename($filename);
|
||||
$dirname = $locator->findResource($dirname, true) ?: $locator->findResource($dirname, true, true);
|
||||
$filename = "{$dirname}/{$basename}";
|
||||
}
|
||||
|
||||
$file = YamlFile::instance($filename);
|
||||
if (!empty($data)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user