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:
Samuel Georges 2017-07-01 12:26:55 +10:00
parent 2424a6563d
commit d1c160f9dc
2 changed files with 23 additions and 2 deletions

View File

@ -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.
*

View File

@ -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);
}
/*