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

Fix query to select circulation rules for Koha #2008 #2009

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions code/web/Drivers/Koha.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,17 @@ public function getCheckouts(User $patron): array {
$circulationRulesForCheckout = [];
/** @noinspection SqlResolve */
/** @noinspection SqlDialectInspection */
$circulationRulesSql = "SELECT * FROM circulation_rules where (categorycode IN ('$patronType', '*') OR categorycode IS NULL) and (itemtype IN('$itemType', '*') OR itemtype is null) and (branchcode IN ('$checkoutBranch', '*') OR branchcode IS NULL) order by branchcode desc, categorycode desc, itemtype desc";
$circulationRulesSql = "
SELECT * FROM circulation_rules
WHERE (categorycode IN ('$patronType', '*') OR categorycode IS NULL)
AND (itemtype IN('$itemType', '*') OR itemtype is null)
AND (branchcode IN ('$checkoutBranch', '*') OR branchcode IS NULL)
ORDER BY branchcode desc, categorycode desc, itemtype desc LIMIT 1
";
$circulationRulesRS = mysqli_query($this->dbConnection, $circulationRulesSql);
if ($circulationRulesRS !== false) {
while ($circulationRulesRow = $circulationRulesRS->fetch_assoc()) {
$circulationRulesForCheckout[] = $circulationRulesRow;
}
$circulationRulesRow = $circulationRulesRS->fetch_assoc();
$circulationRulesForCheckout[] = $circulationRulesRow;
$circulationRulesRS->close();
}
$timer->logTime("Load circulation rules for checkout");
Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.09.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
- Remove superfluous loop in Koha driver function updateHomeLibrary #1968 (*KMH*)
- Hide empty item groups for volume-level holds in Koha (*KMH*)
- Remove old pre-production Koha volumes code (*KMH*)
- Fix query to select circulation rules for Koha (*KMH*)

### GitHub Actions
- Add GitHub Actions to check pull requests for release notes (*KMH*)
Expand Down