Skip to content

Conversation

@BStoneATX
Copy link

@BStoneATX BStoneATX commented Nov 22, 2025

Changes to be committed:
modified: Rock/Web/UI/Controls/Grid/Grid.cs

Proposed Changes

This PR removes a leftover OWIN dependency inside the Actions_ExcelExportClick method in Rock/Web/UI/Controls/Grid/Grid.cs.

Starting in Rock McKinley v17, the OWIN hosting pipeline was removed. However, the Excel export logic still attempts to call:

Context?.GetOwinContext()?.Request?.CallCancelled

On any Rock instance running 17.6+, this results in the following runtime exception whenever a grid is exported to Excel:

InvalidOperationException: No owin.Environment item was found in the context.

This prevents all Excel exports system-wide.

Fix:
The OWIN call has been replaced with a safe fallback:

var cancellationToken = CancellationToken.None;

This removes the dependency on OWIN entirely and restores Excel export functionality on all affected grids.

Why this fix is needed:
• OWIN was removed in Rock 17+
• The old GetOwinContext() call now always throws
• Excel exports crash in all grids
• Replacing the call restores expected behavior with no side effects

Fixes: #

Types of changes
• Bugfix (non-breaking change which fixes an issue)
• New feature
• Breaking change

Checklist
• This is a single-commit PR
• Verified no whitespace/formatting changes
• I have read the Contributing to Rock documentation
• I agree to license my contribution under the Rock Community License Agreement
• Unit tests pass locally
• Added unit/integration tests if appropriate
• Documentation updated if appropriate

Further comments

This issue affects all Excel export functionality on any installation upgraded to Rock 17.6+, including Early Access builds. Since the OWIN pipeline no longer exists, any call to GetOwinContext() will always fail. This minimal fix removes the OWIN dependency and restores normal grid export behavior.

Documentation

No end-user documentation changes required.

Migrations

No migration is required.

 Changes to be committed:
	modified:   Rock/Web/UI/Controls/Grid/Grid.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant