From d903af18fe6c415bd9ddb12cb112ee68cb64e283 Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Fri, 1 Mar 2019 16:00:10 +0000 Subject: [PATCH 1/4] Docblock tidying --- src/services/BlockTypes.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/BlockTypes.php b/src/services/BlockTypes.php index 664a2aa..c85c7f7 100644 --- a/src/services/BlockTypes.php +++ b/src/services/BlockTypes.php @@ -56,7 +56,8 @@ class BlockTypes extends Component * * @param $id * - * @return null + * @return BlockType|null + * @throws BlockTypeNotFoundException */ public function getById($id) { @@ -374,7 +375,7 @@ public function getFieldLayoutIds($context, $fieldId = false) * * @param BlockTypeRecord $blockTypeRecord * - * @return null + * @return BlockType|null */ private function _populateBlockTypeFromRecord(BlockTypeRecord $blockTypeRecord) { From 02016892f36047055e7f5644f3c59db8260f6beb Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Fri, 1 Mar 2019 16:01:01 +0000 Subject: [PATCH 2/4] Added fields refresh to BlockTypes service construct Should fix #46 --- src/services/BlockTypes.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/BlockTypes.php b/src/services/BlockTypes.php index c85c7f7..6f7486b 100644 --- a/src/services/BlockTypes.php +++ b/src/services/BlockTypes.php @@ -51,6 +51,14 @@ class BlockTypes extends Component // Public Methods // ========================================================================= + /** + * BlockTypes constructor. + */ + public function __construct() { + // Refresh fields cache in case something has gone awry + Craft::$app->fields->refreshFields(); + } + /** * Returns a Spoon block type model by its ID * From c36e3e73028b33c8e2c6504c3c16466bd949092f Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Fri, 1 Mar 2019 16:02:43 +0000 Subject: [PATCH 3/4] Fixed a missing changelog entry for 3.3.1 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec17254..bd20e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed - Reverted PR [#46](https://github.com/angell-co/Spoon/pull/46) due to large DB impact resulting in slow page loads +- Fixed an issue where Spoon was not loading on previous versions of an Entry ([#48](https://github.com/angell-co/Spoon/issues/48)) ## 3.3.0 - 2019-02-14 From 5a2f361cd1b5d27ea5439f5cad5ab1160e7e098d Mon Sep 17 00:00:00 2001 From: Josh Angell Date: Fri, 1 Mar 2019 16:04:14 +0000 Subject: [PATCH 4/4] Changelog for 3.3.4 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd20e12..8ab3137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ## Unreleased +## 3.3.4 - 2019-03-01 + +### Fixed +- Fixed an issue where sometimes the fields cache needs refreshing ([#46](https://github.com/angell-co/Spoon/pull/46)) + + ## 3.3.3 - 2019-02-22 ### Fixed