More permissive check for showing location alerts#353
Merged
matt-bernhardt merged 1 commit intomainfrom May 4, 2022
Merged
Conversation
** Why are these changes being introduced: * The most recent location template - introduced last fall - uses too strict a comparison to determine whether a location alert will be shown - the === operator used is different from that used by the older location template (which uses ==). I didn't realize initially the using the stricter comparison would never result in the alert being shown, it seems. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/uxws-1368 ** How does this address that need: * This change reverts the new location template to using the more permissive == operator instead of ===. ** Document any side effects to this change: * I'm still not entirely sure about how the logic of this check works, so there may be some aspect - but I doubt it. This reverts to the same comparison that is working for the other location template.
JPrevost
approved these changes
May 3, 2022
2 tasks
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.
Why are these changes being introduced:
strict a comparison to determine whether a location alert will be
shown - the === operator used is different from that used by the older
location template (which uses ==). I didn't realize initially the
using the stricter comparison would never result in the alert being
shown, it seems.
Compare the new location template at https://github.com/MITLibraries/MITlibraries-parent/blob/main/content-location-2021.php#L74
with the older template at https://github.com/MITLibraries/MITlibraries-parent/blob/main/content-location.php#L97
Relevant ticket(s):
How does this address that need:
permissive == operator instead of ===.
Document any side effects to this change:
so there may be some aspect - but I doubt it. This reverts to the same
comparison that is working for the other location template.
How can a reviewer manually see the effects of these changes?
This branch is current present on the staging server. If you look at the Hayden Library page, you'll note a location alert being shown about the elevators being out of service.
Screenshots (if appropriate)
Staging (showing location alert)

Production (without alert)

Todo:
Requires new or updated plugins, themes, or libraries?
NO
Requires change to deploy process?
NO