Skip to content

Commit

Permalink
Fix unit tests related to loading the current branch.
Browse files Browse the repository at this point in the history
Also rebuild the default SQL file.
  • Loading branch information
mdnoble73 committed Oct 15, 2024
1 parent 9bd780f commit 9fff368
Show file tree
Hide file tree
Showing 5 changed files with 309 additions and 34 deletions.
8 changes: 3 additions & 5 deletions code/web/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,12 @@ function getValidServerNames(): array {
function getGitBranch() {
global $interface;

$branchName = '';
$branchNameWithCommit = '';

$files = [];
foreach (glob('release_notes/*.MD') as $filename) {
foreach (glob(ROOT_DIR . '/release_notes/*.MD') as $filename) {
if (preg_match('/\d{2}\.\d{2}\.\d{2}\.MD/', $filename)) {
$tmp = str_replace('.MD', '', $filename);
$tmp = str_replace('release_notes/', '', $tmp);
/** @noinspection RegExpRedundantEscape */
$tmp = preg_replace('~.*release_notes[\\/]~', '', $tmp);
$files[] = $tmp;
}
}
Expand Down
25 changes: 24 additions & 1 deletion code/web/cron/createDefaultDatabaseScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,30 @@
fwrite($fhnd, "INSERT INTO library (libraryId, subdomain, displayName, finePaymentType, repeatSearchOption, allowPinReset, loginFormUsernameLabel, loginFormPasswordLabel, isDefault, browseCategoryGroupId, groupedWorkDisplaySettingId) VALUES (1,'main','Main Library',0, 'none', 0, 'Library Barcode', 'PIN / Password', 1, 1, 1);\n");
fwrite($fhnd, "INSERT INTO list_indexing_settings VALUES (1,1,0,0);\n");
fwrite($fhnd, "INSERT INTO location (locationId, code, displayName, libraryId, groupedWorkDisplaySettingId, browseCategoryGroupId)VALUES (1,'main','Main Library',1, 1, 1);\n");
fwrite($fhnd, "INSERT INTO materials_request_status VALUES (1,'Request Pending',1,0,'',1,0,-1),(2,'Already owned/On order',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The Library already owns this item or it is already on order. Please access our catalog to place this item on hold. Please check our online catalog periodically to put a hold for this item.',0,0,-1),(3,'Item purchased',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Outcome: The library is purchasing the item you requested. Please check our online catalog periodically to put yourself on hold for this item. We anticipate that this item will be available soon for you to place a hold.',0,0,-1),(4,'Referred to Collection Development - Adult',0,0,'',1,0,-1),(5,'Referred to Collection Development - J/YA',0,0,'',1,0,-1),(6,'Referred to Collection Development - AV',0,0,'',1,0,-1),(7,'ILL Under Review',0,0,'',1,0,-1),(8,'Request Referred to ILL',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The library\'s Interlibrary loan department is reviewing your request. We will attempt to borrow this item from another system. This process generally takes about 2 - 6 weeks.',1,0,-1),(9,'Request Filled by ILL',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Our Interlibrary Loan Department is set to borrow this item from another library.',0,0,-1),(10,'Ineligible ILL',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Your library account is not eligible for interlibrary loan at this time.',0,0,-1),(11,'Not enough info - please contact Collection Development to clarify',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We need more specific information in order to locate the exact item you need. Please re-submit your request with more details.',1,0,-1),(12,'Unable to acquire the item - out of print',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is out of print.',0,0,-1),(13,'Unable to acquire the item - not available in the US',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is not available in the US.',0,0,-1),(14,'Unable to acquire the item - not available from vendor',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is not available from a preferred vendor.',0,0,-1),(15,'Unable to acquire the item - not published',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The item you requested has not yet been published. Please check our catalog when the publication date draws near.',0,0,-1),(16,'Unable to acquire the item - price',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item does not fit our collection guidelines.',0,0,-1),(17,'Unable to acquire the item - publication date',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item does not fit our collection guidelines.',0,0,-1),(18,'Unavailable',0,1,'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The item you requested cannot be purchased at this time from any of our regular suppliers and is not available from any of our lending libraries.',0,0,-1),(19,'Cancelled by Patron',0,0,'',0,1,-1),(20,'Cancelled - Duplicate Request',0,0,'',0,0,-1);\n");
fwrite($fhnd, "INSERT INTO `materials_request_status` (`id`, `description`, `isDefault`, `sendEmailToPatron`, `emailTemplate`, `isOpen`, `isPatronCancel`, `libraryId`, `checkForHolds`, `holdPlacedSuccessfully`, `holdFailed`, `holdNotNeeded`) VALUES
(1, 'Request Pending', 1, 0, '', 1, 0, -1, 0, 0, 0, 0),
(2, 'Already owned/On order', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The Library already owns this item or it is already on order. Please access our catalog to place this item on hold. Please check our online catalog periodically to put a hold for this item.', 0, 0, -1, 0, 0, 0, 0),
(3, 'Item purchased', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Outcome: The library is purchasing the item you requested. Please check our online catalog periodically to put yourself on hold for this item. We anticipate that this item will be available soon for you to place a hold.', 1, 0, -1, 1, 0, 0, 0),
(4, 'Referred to Collection Development - Adult', 0, 0, '', 1, 0, -1, 0, 0, 0, 0),
(5, 'Referred to Collection Development - J/YA', 0, 0, '', 1, 0, -1, 0, 0, 0, 0),
(6, 'Referred to Collection Development - AV', 0, 0, '', 1, 0, -1, 0, 0, 0, 0),
(7, 'ILL Under Review', 0, 0, '', 1, 0, -1, 0, 0, 0, 0),
(8, 'Request Referred to ILL', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The library\'s Interlibrary loan department is reviewing your request. We will attempt to borrow this item from another system. This process generally takes about 2 - 6 weeks.', 1, 0, -1, 0, 0, 0, 0),
(9, 'Request Filled by ILL', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Our Interlibrary Loan Department is set to borrow this item from another library.', 0, 0, -1, 0, 0, 0, 0),
(10, 'Ineligible ILL', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. Your library account is not eligible for interlibrary loan at this time.', 0, 0, -1, 0, 0, 0, 0),
(11, 'Not enough info - please contact Collection Development to clarify', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We need more specific information in order to locate the exact item you need. Please re-submit your request with more details.', 1, 0, -1, 0, 0, 0, 0),
(12, 'Unable to acquire the item - out of print', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is out of print.', 0, 0, -1, 0, 0, 0, 0),
(13, 'Unable to acquire the item - not available in the US', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is not available in the US.', 0, 0, -1, 0, 0, 0, 0),
(14, 'Unable to acquire the item - not available from vendor', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item is not available from a preferred vendor.', 0, 0, -1, 0, 0, 0, 0),
(15, 'Unable to acquire the item - not published', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The item you requested has not yet been published. Please check our catalog when the publication date draws near.', 0, 0, -1, 0, 0, 0, 0),
(16, 'Unable to acquire the item - price', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item does not fit our collection guidelines.', 0, 0, -1, 0, 0, 0, 0),
(17, 'Unable to acquire the item - publication date', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. We regret that we are unable to acquire the item you requested. This item does not fit our collection guidelines.', 0, 0, -1, 0, 0, 0, 0),
(18, 'Unavailable', 0, 1, 'This e-mail is to let you know the status of your recent request for an item that you did not find in our catalog. The item you requested cannot be purchased at this time from any of our regular suppliers and is not available from any of our lending libraries.', 0, 0, -1, 0, 0, 0, 0),
(19, 'Cancelled by Patron', 0, 0, '', 0, 1, -1, 0, 0, 0, 0),
(20, 'Cancelled - Duplicate Request', 0, 0, '', 0, 0, -1, 0, 0, 0, 0),
(21, 'Hold Placed', 0, 1, '0', 0, 0, -1, 0, 1, 0, 0),
(22, 'Hold Failed', 0, 1, '0', 0, 0, -1, 0, 0, 1, 0),
(23, 'Hold Not Needed', 0, 1, '0', 0, 0, -1, 0, 0, 0, 1);\n");
/** @noinspection SqlWithoutWhere */
fwrite($fhnd, "UPDATE modules set enabled=0;UPDATE modules set enabled=1 where name in ('Side Loads', 'User Lists');\n");
fwrite($fhnd, "INSERT INTO system_variables (currencyCode, storeRecordDetailsInSolr, storeRecordDetailsInDatabase, indexVersion, searchVersion, appScheme, trackIpAddresses) VALUES ('USD', 0, 1, 2, 2, 'aspen-lida', 0); \n");
Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.10.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
- When batch updating enumerations, display the label for the new value rather than the internal value. (*MDN*)
- Remove debugging code when sending emails with SMTP (*MAF*, *MDN*)
- Fix an issue where EBSCO EDS search errors were echoed to the UI on the search page (visible to any visitor) by adding the error message to the logs instead. (*CZ*)
- Fix unit tests related to loading the current branch. (*MDN*)

## This release includes code contributions from
###ByWater Solutions
Expand Down
12 changes: 6 additions & 6 deletions code/web/sys/DBMaintenance/version_updates/24.10.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ function getUpdates24_10_00(): array {
'continueOnError' => false,
'sql' => [
"UPDATE materials_request_status SET isOpen = 1, checkForHolds = 1 where description='Item purchased' and libraryId = -1",
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, holdPlacedSuccessfully, libraryId)
VALUES ('Hold Placed', 1, '{title} has been received by the library and you have been added to the hold queue.
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, isPatronCancel, holdPlacedSuccessfully, libraryId)
VALUES ('Hold Placed', 1, 0, '{title} has been received by the library and you have been added to the hold queue.
Thank you for your purchase suggestion!', 0, 1, -1)",
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, holdFailed, libraryId)
VALUES ('Hold Failed', 1, '{title} has been received by the library, however we were not able to add you to the hold queue. Please ensure that your account is in good standing and then visit our catalog to place your hold.
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, isPatronCancel, holdFailed, libraryId)
VALUES ('Hold Failed', 1, 0, '{title} has been received by the library, however we were not able to add you to the hold queue. Please ensure that your account is in good standing and then visit our catalog to place your hold.
Thanks', 0, 1, -1)",
]
Expand All @@ -125,8 +125,8 @@ function getUpdates24_10_00(): array {
'description' => 'Update default material request statuses pt 2',
'continueOnError' => false,
'sql' => [
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, holdNotNeeded, libraryId)
VALUES ('Hold Not Needed', 1, '', 0, 1, -1)",
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, isPatronCancel, holdNotNeeded, libraryId)
VALUES ('Hold Not Needed', 1, 0, '', 0, 1, -1)",
]
], //update_default_request_statuses_2
'materials_request_hold_candidate_generation_log' => [
Expand Down
297 changes: 275 additions & 22 deletions install/aspen.sql

Large diffs are not rendered by default.

0 comments on commit 9fff368

Please sign in to comment.