mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Check both instances to fix #1854
It appears there is no way around this. All directories should be lower case in October, prior to this, October wanted uppercase characters. Make up your mind guy, come on! ;-)
This commit is contained in:
parent
2424a6563d
commit
d1c160f9dc
@ -88,6 +88,28 @@ class ComponentPartial extends Extendable implements CmsObjectContract
|
||||
return static::load($component, $fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a partial override exists in the supplied theme and returns it.
|
||||
* Since the beginning of time, October inconsistently checked for overrides
|
||||
* using the component alias exactly, resulting in a folder with uppercase
|
||||
* characters, subsequently this method checks for both variants.
|
||||
*
|
||||
* @param \Cms\Classes\Theme $theme
|
||||
* @param \Cms\Classes\ComponentBase $component
|
||||
* @param string $fileName
|
||||
* @return mixed
|
||||
*/
|
||||
public static function loadOverrideCached($theme, $component, $fileName)
|
||||
{
|
||||
$partial = Partial::loadCached($theme, strtolower($component->alias) . '/' . $fileName);
|
||||
|
||||
if ($partial === null) {
|
||||
$partial = Partial::loadCached($theme, $component->alias . '/' . $fileName);
|
||||
}
|
||||
|
||||
return $partial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a single template by its file name.
|
||||
*
|
||||
|
@ -818,8 +818,7 @@ class Controller
|
||||
* Check if the theme has an override
|
||||
*/
|
||||
if (strpos($partialName, '/') === false) {
|
||||
$overrideName = strtolower($componentObj->alias) . '/' . $partialName;
|
||||
$partial = Partial::loadCached($this->theme, $overrideName);
|
||||
$partial = ComponentPartial::loadOverrideCached($this->theme, $componentObj, $partialName);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user