diff --git a/components/com_content/View/Archive/HtmlView.php b/components/com_content/View/Archive/HtmlView.php index 2fb43684585f1..30ad6db42ac82 100644 --- a/components/com_content/View/Archive/HtmlView.php +++ b/components/com_content/View/Archive/HtmlView.php @@ -14,6 +14,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Plugin\PluginHelper; @@ -99,7 +100,9 @@ class HtmlView extends BaseHtmlView * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * - * @return mixed A string if successful, otherwise an Error object. + * @return void + * + * @throws GenericDataException */ public function display($tpl = null) { @@ -108,6 +111,11 @@ public function display($tpl = null) $items = $this->get('Items'); $pagination = $this->get('Pagination'); + if ($errors = $this->getModel()->getErrors()) + { + throw new GenericDataException(implode("\n", $errors), 500); + } + // Flag indicates to not add limitstart=0 to URL $pagination->hideEmptyLimitstart = true;