Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data with $processorConfiguration option 'returnFlattenObject'==1 should also be returned under $targetVariableName #739

Open
dacko-sk opened this issue Jun 13, 2024 · 0 comments

Comments

@dacko-sk
Copy link

When using DatabaseQueryProcessor with returnFlattenObject=1 (only 1 record item expected on output instead of array of records), this method returns data without the $targetVariableName key specified via 'as' option
return array_shift($processedRecordVariables);
while when returnFlattenObject is not set, the method returns the data under the $targetVariableName key
[ $targetVariableName => $processedRecordVariables; ]

Issue in file:

return array_shift($processedRecordVariables);

This could be resolved by changing the line 126 to something like
$processedRecordVariables = $processedRecordVariables[0] ?? [];
without returning it and letting the line 132 to return the whole $processedData as usual - with the data appended under the $targetVariableName key on line 130.

Thanks for checking.

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

No branches or pull requests

1 participant