diff --git a/src/Model/BlogPost.php b/src/Model/BlogPost.php index 77f36e43d..31b0c7b8b 100644 --- a/src/Model/BlogPost.php +++ b/src/Model/BlogPost.php @@ -312,6 +312,11 @@ public function getCMSFields() ); } + $shouldLazyLoadCategories = true; + if($this->Categories()->count() < 15) { + $shouldLazyLoadCategories = false; + } + // Get categories and tags // @todo: Reimplement the sidebar // $options = BlogAdminSidebar::create( @@ -326,7 +331,7 @@ public function getCMSFields() $this->Categories() ) ->setCanCreate($this->canCreateCategories()) - ->setShouldLazyLoad(true), + ->setShouldLazyLoad($shouldLazyLoadCategories), TagField::create( 'Tags', _t(__CLASS__ . '.Tags', 'Tags'),