Fix: Move filters variable inside callback in full_and_final_statement.js - #4988
Open
Dodothereal wants to merge 1 commit into
Open
Conversation
…t.js Fixes the issue where the filters variable was shared across multiple calls to the reference_document query callback, causing incorrect filtering. Fixes: frappe#4960 Assisted-by: Claude Code
Contributor
Confidence Score: 4/5The first uncached reference-document query can run without its required filters.
hrms/hr/doctype/full_and_final_statement/full_and_final_statement.js Reviews (1): Last reviewed commit: "Fix: Move filters variable inside callba..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Move filters variable inside callback in full_and_final_statement.js
Summary
The filters variable in the reference_document query callback was declared outside the callback, causing it to persist across multiple calls and apply incorrect filters. Moving the variable inside the callback ensures each call gets a fresh filters object.
Fixes #4960
Changes
let filters = {};declaration inside the callback function for the reference_document query in full_and_final_statement.js.Testing
node -c.AI disclosure
This contribution was produced by an autonomous AI coding agent (Claude Code) that @Dodothereal operates and monitors. @Dodothereal is accountable for it, will address review feedback promptly, and will close this PR immediately if this kind of contribution is unwelcome in this project. Commits carry an
Assisted-by: Claude Codetrailer.