Closed DL6ER closed 5 months ago
Now Gravity Update page works, but All Settings page is empty (even using the toggle button).
Now we recall why the code was there :-) Should be fixed.
Now:
/index
), the menu will show only the Basic pages.We need to run applyExpertSettings()
in all pages, but we need a different redirect rule.
We should redirect only:
if ( $(".settings-selector").length !== 0 )
) ANDThe original issue is $(".box:visible").length
will be zero in 2 cases:
.box
elements at all
(this causes the issue in Gravity page and can also cause issues in other pages without this element). Suggestion:
Revert all commits and change this code:
// If we left with an empty page (no visible boxes) after switching from
// Expert to Basic settings, redirect to admin/settings/system instead
- if ($(".box:visible").length === 0) {
+ if ($(".settings-selector").length !== 0 && $(".box:visible").length === 0) {
window.location.href = "/admin/settings/system";
}
This will trigger the redirect only if:
settings-selector
is present (this class is present in every settings pages, but not in other pages)
AND
What does this implement/fix?
We should not try to apply settings levels (incl. all the consequences such as ill-fated redirects) when we have already detected that there are no expert-settings elements on this page.
Related issue or feature (if applicable): https://github.com/pi-hole/web/issues/2992
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.