File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed
modules/mod_tags_popular/src/Dispatcher Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -28,28 +28,10 @@ class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareI
2828{
2929 use HelperFactoryAwareTrait;
3030
31- /**
32- * Runs the dispatcher.
33- *
34- * @return void
35- *
36- * @since 5.1.0
37- */
38- public function dispatch ()
39- {
40- $ displayData = $ this ->getLayoutData ();
41-
42- if (!\count ($ displayData ['list ' ]) && !$ displayData ['params ' ]->get ('no_results_text ' )) {
43- return ;
44- }
45-
46- parent ::dispatch ();
47- }
48-
4931 /**
5032 * Returns the layout data.
5133 *
52- * @return array
34+ * @return array|false
5335 *
5436 * @since 5.1.0
5537 */
@@ -67,6 +49,11 @@ protected function getLayoutData()
6749 $ data ['list ' ] = ModuleHelper::moduleCache ($ this ->module , $ data ['params ' ], $ cacheparams );
6850 $ data ['display_count ' ] = $ data ['params ' ]->get ('display_count ' , 0 );
6951
52+ // Stop rendering if there are no results and no fallback text
53+ if (!\count ($ data ['list ' ]) && !$ data ['params ' ]->get ('no_results_text ' )) {
54+ return false ;
55+ }
56+
7057 return $ data ;
7158 }
7259}
You can’t perform that action at this time.
0 commit comments