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.
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
OSOE-548: Upgrade to Orchard Core 1.6 in Hosting-Tenants #55
OSOE-548: Upgrade to Orchard Core 1.6 in Hosting-Tenants #55
Changes from 31 commits
8bc572b
a8eb49c
902ae2f
abfa52d
51edc12
a976c9d
428c37e
73f0cb4
47e98e5
5a6e309
c482b98
96a3b30
4b959bd
0a88d60
d9a519d
3ad6851
ba11aa8
d3a2051
97f31af
ac98adc
cb7a796
9b7a9bd
6dc78ee
5dfef24
e577208
4624660
ddf1f4e
4d48731
6edeb65
8947a01
691d54d
a0fa3e7
4084db8
153dc18
ae8c2e4
db022b6
61e337d
7cd9f86
01fffcc
e59ee8d
8523609
7727f2d
14e36aa
070548d
1f23c93
581877d
92d37e5
a68fd1a
f6f5550
b50508c
c605bc8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 before, try to use and check a
_deferredTask
boolean as suggested.It prevents many deferred tasks from being triggered.
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.
@jtkech I tried the
_deferredTaskExecuted
boolean like you have suggested but there is a catch for me with it.So it basically prevents the handler to run multiple times that is understandable but this for me kills the functionality of the half feature.
For example
OrchardCore.Facebook
andOrchardCore.Twitter
will be enabled ifLombiq.UIKit
is enabled.But after this point if I disable
Lombiq.UIKit
the other 2 features will remain enabled. Also If I want to turn off Facebook I can turn it off eventhough it should stay enabled becauseLombiq.UIKit
is still enabled.But the handler is not running once more because of the boolean set to true.
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.
This delegate handles any number of features to be enabled/disabled, no? So it shouldn't require running more than once for an updated shell.
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.
@Piedone The problem if it runs once than as I described
@jtkech Here is my repro if I use
_deferredTask
boolean:_deferredTask
will be true.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.
Thanks for the repro, I will try it this night.
Can you show me the code that registers the handler and defines the
_deferredTask
variable.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.
@jtkech Sending you what you need.
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.
For me this is preventing the handler to ever be executed again.
So basically this will execute only once when the tenant is being initialized.
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.
Okay just retried, I can't repro, it works well on my side,
_deferredTask
is false again when the handler is resolved from another scope. Did you retry it with the new code where states are retrieved and all the logic done in the deferred task?I used the same code unless that I always configure the options by code (one conditional/condition) and that I always register the handler by code, looks like you are doing it through a module/feature startup.
Okay, just retried by using a separate
OC.FeaturesGuard
that I included in the setup recipe, all still works fine, the only difference is that I still always config my testing options by code (not from the configuration) in the module startup.As a side note, not tried but I think you could get rid of the
ConditionallyEnabledFeatures
config section and then bind directly onConditionallyEnabledFeaturesOptions
, but as you want.