- Issue created by @Gold
- π¨π¦Canada gapple
I think I agree with that change - IIRC, my thought was that viewing that there is an enforced policy and its values would be important.
But if editing is the priority then having the report-only policy default makes sense. There's also the tab summary which indicates that a policy is enabled (and how many directives), and β¨ Copy configuration between report-only and enforced Active would help with suggested workflow of tweaking the report-only policy, then copying it to enforced after testing.I would not switch the order of the form tabs though. There is a following line that causes the switch to have the enforced policy tab as default if it is enabled:
if ($config->get($policyTypeKey . '.enable')) { $form['policies']['#default_tab'] = 'edit-' . $policyTypeKey; }
- π³πΏNew Zealand Gold 20 minutes in the future
@grapple, I did look at that snippet and tracked back to where the config for that value was being set. It started getting a bit convoluted though and I had a bit of time pressure.
This value seems to be being set in 1 place when the form is first submitted in CspSettingsForm.php:631.
I tried flipping the order that $policyTypeKey was processing at L626 but that didn't make any difference either.
I think the issue is tying the
$form['policies']['#default_tab']
to the value in that config var.An alternative could be to add
#weight
to the$form[$policyTypeKey]
array.I'll push an update for that in a moment. Let me know what you think.
-
gapple β
committed b34ab2fd on 2.x
Issue #3418744: Always set report-only options as default active tab
-
gapple β
committed b34ab2fd on 2.x
-
gapple β
committed b9cffa1e on 8.x-1.x
Issue #3418744: Always set report-only options as default active tab
-
gapple β
committed b9cffa1e on 8.x-1.x
- Status changed to Fixed
4 months ago 2:23am 13 February 2024 - π¨π¦Canada gapple
I've just set the report-only options to always be default - I don't think having it switch to enforced if that's the only enabled policy provides much benefit, and having it always show the first possible tab is clear and consistent behaviour (that also reduces the likelyhood of making inadvertent changes to the enforced policy).
Automatically closed - issue fixed for 2 weeks with no activity.