From 87f8f8feb161ca823b314c2dfbd1eadeaa59ba8f Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Tue, 27 Jun 2017 05:34:13 +1000 Subject: [PATCH] Fixes inconsistency in component partial folder names This is a breaking change that will require further attention - refs #1854 Eg: myComponent, the default component partial would use lower case folders - /plugins/acme/test/components/mycomponent/default.htm The theme component partial override would use case sensitive folders - /themes/foobar/partials/myComponent/default.htm This is fixed as - /themes/foobar/partials/mycomponent/default.htm Minor code fix to ModelBehavior class --- modules/cms/classes/Controller.php | 2 +- modules/system/classes/ModelBehavior.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 5bc8ebac1..273400644 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -818,7 +818,7 @@ class Controller * Check if the theme has an override */ if (strpos($partialName, '/') === false) { - $overrideName = $componentObj->alias . '/' . $partialName; + $overrideName = strtolower($componentObj->alias) . '/' . $partialName; $partial = Partial::loadCached($this->theme, $overrideName); } diff --git a/modules/system/classes/ModelBehavior.php b/modules/system/classes/ModelBehavior.php index 2457df0e7..af76b8e7d 100644 --- a/modules/system/classes/ModelBehavior.php +++ b/modules/system/classes/ModelBehavior.php @@ -28,8 +28,7 @@ class ModelBehavior extends ModelBehaviorBase /* * Validate model properties */ - foreach ($this->requiredProperties as $property) - { + foreach ($this->requiredProperties as $property) { if (!isset($model->{$property})) { throw new ApplicationException(Lang::get('system::lang.behavior.missing_property', [ 'class' => get_class($model),