Skip to content

Commit 9ad2aa6

Browse files
authored
[5.4] Fix duplicate getLayoutData execution in mod_tags_popular (#46827)
1 parent 641acbe commit 9ad2aa6

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

modules/mod_tags_popular/src/Dispatcher/Dispatcher.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)