Skip to content

Commit

Permalink
Merge pull request #2009 from kylemhall/issue_2008
Browse files Browse the repository at this point in the history
Fix query to select circulation rules for Koha #2008
  • Loading branch information
mdnoble73 authored Aug 22, 2024
2 parents 537e9aa + 7c48252 commit 1175f38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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 @@ -142,6 +142,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

0 comments on commit 1175f38

Please sign in to comment.