- Affected version
- 2.3.0
PHP:
public function actionView(ParameterBag $params)
{
$option = $this->assertOptionExists($params['option_id']);
$relation = $option->Relations->first();
$group = $relation ? $relation->OptionGroup : null;
return $this->redirect(
$group ? $this->buildLink('options/groups', $group) . '#' . $option->option_id : $this->buildLink('options')
);
}
If the option is shown in multiple groups and the first group belongs to an Add-on that is disabled only an error will be displayed although the option might still be accessible via other groups:
Suggested Fix
Check the relations if the Add-on the group belogs to is enabled until one is found that is enabled (or all groups have been checked) before redirecting.
Code:
--- src/XF/Admin/Controller/OptionController.php Mon Jul 22 15:23:17 2024
+++ src/XF/Admin/Controller/OptionController.php Mon Jul 22 15:26:30 2024
@@ -412,3 +412,9 @@
- $relation = $option->Relations->first();
+ foreach ($option->Relations as $relation)
+ {
+ if (!$relation->OptionGroup->AddOn || !$relation->OptionGroup->AddOn->active)
+ {
+ continue;
+ }
+ }
$group = $relation ? $relation->OptionGroup : null;
Last edited: