Skip to content

fix: initialize ProfileManagementPageCreationContext in OnPostAsync of ManageModel#25067

Merged
yagmurcelk merged 1 commit into
rel-10.1from
fix/manage-page-post-null-reference
Mar 13, 2026
Merged

fix: initialize ProfileManagementPageCreationContext in OnPostAsync of ManageModel#25067
yagmurcelk merged 1 commit into
rel-10.1from
fix/manage-page-post-null-reference

Conversation

@maliming

Copy link
Copy Markdown
Member

ManageModel.OnPostAsync returned Page() without initializing ProfileManagementPageCreationContext, causing a NullReferenceException when the view tried to render Model.ProfileManagementPageCreationContext.Groups inside the <abp-tabs> tag helper.

Although normal usage relies on JavaScript to intercept form submissions (using AJAX instead of a native HTML POST), a direct POST to /Account/Manage — triggered by JS being disabled, a JS load failure, or an automated tool — would hit OnPostAsync and crash during view rendering.

The fix mirrors the initialization logic from OnGetAsync: creating a new ProfileManagementPageCreationContext and running all registered contributors through it before returning Page().

Copilot AI review requested due to automatic review settings March 11, 2026 07:43
@maliming maliming changed the base branch from dev to rel-10.1 March 11, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Account “Manage” Razor Page model so that POST requests rebuild the ProfileManagementPageCreationContext and run all configured ProfileManagementPageOptions.Contributors, matching the GET behavior and ensuring the page can render correctly after a POST.

Changes:

  • Make OnPostAsync asynchronous.
  • Initialize ProfileManagementPageCreationContext on POST and run contributors via ConfigureAsync.

@maliming maliming requested a review from yagmurcelk March 11, 2026 07:51
@yagmurcelk yagmurcelk merged commit 6b80dc5 into rel-10.1 Mar 13, 2026
7 checks passed
@yagmurcelk yagmurcelk deleted the fix/manage-page-post-null-reference branch March 13, 2026 09:19
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.

3 participants