-
Notifications
You must be signed in to change notification settings - Fork 1.4k
#8862: Preventing the SQL Server Service Broker feature from being enabled for tenants that are not using Microsoft SQL Server as their database provider (Lombiq Technologies: ORCH-309) #8875
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
base: dev
Are you sure you want to change the base?
Conversation
…or tenants that are not using Microsoft SQL Server as their database provider
| /// <summary> | ||
| /// Prevents the SQL Server Service Broker feature from being enabled for tenants that are not using | ||
| /// Microsoft SQL Server as their database provider. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// The implementation is hackish but there seems to be no other way: if it would use <see cref="Orchard.UI.Notify.INotifier"/> | ||
| /// it wouldn't work since <see cref="Orchard.UI.Notify.NotifyFilter"/> that writes out notifications to TempData | ||
| /// runs before feature events are raised. Thus we have to manually add the messages to TempData, just as the filter | ||
| /// would do. | ||
| /// </remarks> |
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.
Namespace and rewrap:
| /// <summary> | |
| /// Prevents the SQL Server Service Broker feature from being enabled for tenants that are not using | |
| /// Microsoft SQL Server as their database provider. | |
| /// </summary> | |
| /// <remarks> | |
| /// The implementation is hackish but there seems to be no other way: if it would use <see cref="Orchard.UI.Notify.INotifier"/> | |
| /// it wouldn't work since <see cref="Orchard.UI.Notify.NotifyFilter"/> that writes out notifications to TempData | |
| /// runs before feature events are raised. Thus we have to manually add the messages to TempData, just as the filter | |
| /// would do. | |
| /// </remarks> | |
| /// <summary> | |
| /// Prevents the SQL Server Service Broker feature from being enabled for tenants that are not using Microsoft SQL | |
| /// Server as their database provider. | |
| /// </summary> | |
| /// <remarks> | |
| /// The implementation is hackish but there seems to be no other way: if it would use <see cref="INotifier"/> it | |
| /// wouldn't work since <see cref="NotifyFilter"/> that writes out notifications to TempData runs before feature | |
| /// events are raised. Thus we have to manually add the messages to TempData, just as the filter would do. | |
| /// </remarks> |
|
|
||
| public void Uninstalling(Feature feature) { } | ||
|
|
||
|
|
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.
| AddNotification( | ||
| T("The SQL Server Service Broker cannot be enabled because it requires Microsoft SQL Server."), | ||
| NotifyType.Error); |
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.
Can you please check if you see the same behavior: When enabling SqlServerServiceBroker while Orchard.MessageBus is also disabled, then the notification will not be displayed. If I disable SqlServerServiceBroker and then enable it again (and thus Orchard.MessageBus is already enabled) then the notification is displayed.
|
|
||
| public void Installed(Feature feature) { } | ||
|
|
||
| public void Enabling(Feature feature) { } |
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.
Please check if we can store here whether SqlServerServiceBroker's dependencies (there's only Orchard.MessageBus, but don't wire that in) are already enabled or not. Those that aren't should also be disabled along with SqlServerServiceBroker in the Enabled handler.
| notifyType.ToString() + | ||
| ":" + | ||
| message.Text + | ||
| System.Environment.NewLine + | ||
| "-" + | ||
| System.Environment.NewLine; |
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.
| notifyType.ToString() + | |
| ":" + | |
| message.Text + | |
| System.Environment.NewLine + | |
| "-" + | |
| System.Environment.NewLine; | |
| $"{notifyType}:{message.Text}{System.Environment.NewLine}-{System.Environment.NewLine}"; |
Fixes #8862.