-
Notifications
You must be signed in to change notification settings - Fork 118
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
Reset contexts before evaluation. #932
Conversation
src/IslandoraContextManager.php
Outdated
// XXX: Ensure that no earlier executed contexts in the request are still | ||
// present. | ||
$this->resetContextEvaluation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just figured I'd get this written down, but... having thoughts that this might have something of a performance impact on typical site execution stuff, where contexts might be used for it's typical use case of block placements and influencing viewing and the like, wondering if it might make sense to only reset if $provided
is not empty, which I believe should only be when we are responding to something from IslandoraUtils
(or some other mechanism that has provided the contexts that we are to use).
Alternatively, might it make sense to roll our own particular islandora.context.manager
service or something of the like instead of replacing the context.manager
as we do presently, to avoid impacts on the more expected uses of the context.manager
service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Met with @adam-vessey internally, going to attempt to implement his above suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought there is potentially some concern about BC breaking here if we were going to alter the islandora.context.manager
in this way. Going to insulate the above resets for the time being in this commit and bring up the discussion at the next tech call.
@jordandukart , should I test this with or without #2213 also applied? |
You can test without 2213 applied. The changes there are upstream |
* Reset contexts before evaluation. * Only reset when Islandora's ContextProviders are being used.
GitHub Issue: Islandora/documentation#2213
Release pull requests, etc.)
Fix for documentation 2069 #931
What does this Pull Request do?
Resets contexts before they are evaluated so actions don't get executed that shouldn't be.
What's new?
Forcing contexts and conditions to be re-evaluated given how Islandora uses
Context
in a non-standard way.Possibly, if actions that had bad conditions set were being executed before and not breaking things.
How should this be tested?
Testing steps are within Islandora/documentation#2213.
Interested parties
@Islandora/committers