From fa1198f4b09d4b2aa1097fb16afe8f34a5c2a272 Mon Sep 17 00:00:00 2001 From: wilsonge Date: Sat, 11 Jan 2020 01:05:10 +0000 Subject: [PATCH] Fix month filter in com_content --- libraries/cms/html/content.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/cms/html/content.php b/libraries/cms/html/content.php index c5cc76c21bd9d..ec8c4d602b09f 100644 --- a/libraries/cms/html/content.php +++ b/libraries/cms/html/content.php @@ -60,7 +60,11 @@ public static function prepare($text, $params = null, $context = 'text') */ public static function months($state) { - $model = BaseDatabaseModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); + /** @var \Joomla\Component\Content\Administrator\Extension\ContentComponent $contentComponent */ + $contentComponent = Factory::getApplication()->bootComponent('com_content'); + + $model = $contentComponent->getMVCFactory() + ->createModel('Articles', '', ['ignore_request' => true]); foreach ($state as $key => $value) {