Skip to content

Commit c540973

Browse files
authored
Merge pull request #316 from VSEphpbb/issue/314
Fall back rules page to default lang
2 parents c997183 + 5fcc2a9 commit c540973

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controller/main_controller.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ public function display()
8989
// Grab all the rules in the current user's language
9090
$entities = $this->rule_operator->get_rules($this->lang->get_used_language());
9191

92+
// If no rules were found, it may be because no rules exist in the current user's
93+
// language, so let's look for rules in the board's default language as a fallback.
94+
if (empty($entities) && $this->lang->get_used_language() !== $this->config['default_lang'])
95+
{
96+
$entities = $this->rule_operator->get_rules($this->config['default_lang']);
97+
}
98+
9299
/* @var $entity \phpbb\boardrules\entity\rule */
93100
foreach ($entities as $entity)
94101
{

0 commit comments

Comments
 (0)