[DQT] Fix Data Query Tool execution for BMI and MRI (#10129, #9772)#10298
Merged
[DQT] Fix Data Query Tool execution for BMI and MRI (#10129, #9772)#10298
Conversation
Contributor
Author
|
Also resolves #9829 |
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.
Brief summary of changes
This PR fixes a critical bug in
InstrumentQueryEnginethat prevented queries from running successfully for certain instruments, specifically resolving issues with BMI (#10129) and MRI (#9772).The root cause was a misplaced
yieldstatement within the_dataToIteratormethod inmodules/instruments/php/instrumentqueryengine.class.inc.The Bug:
The
yieldstatement was inside the innerforeachloop that iterates through selected fields. This caused the generator to yield a result for every single field being processed for a candidate.The Fix:
I moved the
yieldstatement outside the inner loop. Now, the code correctly iterates through all requested fields to build the complete data array for a candidate before yielding it.BMI Screenshot:

MRI Screenshot:

It's always satisfying when a single line change, literally moving one line down using whitespace simultaneously solves two separate issues!
Link(s) to related issue(s)
[DQT] - Query not run yet #9772