Commit 869c035
authored
fix: persist custom date filter across syslog page navigation (#251)
* fix: persist custom date filter across syslog page navigation
When a user sets a custom date range and then navigates to the next
page, the shift_span detection runs before validate_store_request_vars
restores session values. shift_span was false (no date params in the
page link), causing set_shift_span() to fall into the 'span' branch,
which recalculated dates from predefined_timespan and killed the
session date vars -- wiping the custom filter.
Two-part fix:
- In the 'custom' case, save date1/date2 to session (same pattern
the existing 'shift' case already uses) so page navigation can
find them.
- Distinguish page navigation with saved custom dates (shift_span
false + session dates present) from an explicit predefined-timespan
selection. Only recalculate from predefined_timespan when no custom
dates are in session.
Fixes #250
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix: guard session date keys with isset before access in set_shift_span
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix: guard both _date1 and _date2 session keys in set_shift_span
If _date1 exists but _date2 is absent (partial session state), the old
check passed the guard and entered the pagination-restore path. The
inner isset() at line 800 already fell back safely, but the outer guard
now explicitly requires both keys to avoid confusing partial-session
scenarios.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* chore: add CHANGELOG entry for develop
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>1 parent 09e06ad commit 869c035
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
798 | 813 | | |
799 | 814 | | |
800 | 815 | | |
| |||
826 | 841 | | |
827 | 842 | | |
828 | 843 | | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
829 | 847 | | |
830 | 848 | | |
831 | 849 | | |
| |||
0 commit comments