Skip to content

Fix: Save the selected filter level in the session on Log page#4837

Open
IgorA100 wants to merge 3 commits into
ZoneMinder:masterfrom
IgorA100:patch-504146
Open

Fix: Save the selected filter level in the session on Log page#4837
IgorA100 wants to merge 3 commits into
ZoneMinder:masterfrom
IgorA100:patch-504146

Conversation

@IgorA100
Copy link
Copy Markdown
Contributor

  • In \skins\classic\views\log.php, we tried to read the `ZM_LOG_FILTER_LEVEL' session, but it was always empty because we didn't save anything to it.
  • Let's rename ZM_LOG_FILTER_LEVEL' to zmLogFilterLevel' for code consistency.

@IgorA100 IgorA100 marked this pull request as ready for review May 16, 2026 21:30
@connortechnology connortechnology requested a review from Copilot May 16, 2026 23:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes persistence of the selected log Level filter on the classic skin System Log page by saving the chosen level into the user session (and renaming the session key to match existing naming patterns like zmLogComponent).

Changes:

  • Read the selected log level from $_SESSION['zmLogFilterLevel'] when rendering the Level filter dropdown.
  • Persist the requested log level (level) into $_SESSION['zmLogFilterLevel'] during AJAX log queries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
web/skins/classic/views/log.php Switches the Level filter’s selected value to use the new session key (zmLogFilterLevel).
web/ajax/log.php Saves the requested Level filter value into the session during task=query requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/ajax/log.php Outdated
Comment thread web/ajax/log.php Outdated
@IgorA100 IgorA100 marked this pull request as draft May 17, 2026 16:52
Open and close the session only once per page refresh.
First, save all changes in the $newSessionValue array, then open the session, set the new session values, and close the session.
Only write the correct $_REQUEST['level'] values ​​to "zmLogFilterLevel" (if they are in ZM\Logger::$codes).
@IgorA100
Copy link
Copy Markdown
Contributor Author

@connortechnology
I've made the necessary corrections.

@IgorA100 IgorA100 marked this pull request as ready for review May 17, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants