Skip to content
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

[release/8.0-preview6] [Blazor] Allow properties marked with both [Parameter] and [SupplyParameterFromQuery] to receive values directly #49038

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

MackinnonBuck
Copy link
Member

@MackinnonBuck MackinnonBuck commented Jun 26, 2023

Allow properties marked with both [Parameter] and [SupplyParameterFromQuery] to receive values directly

Fixes an issue where if a component parameter was marked with both [Parameter] and [SupplyParameterFromQuery], a misleading exception message would be thrown when the parameter's value was set directly.

Backport of #48954

Description

Since #48554 was merged, marking a component parameter with both [Parameter] and [SupplyParameterFromQuery] would cause the following exception to be thrown if the parameter was set directly:

Object of type 'MyComponent' has a property matching the name 'MyParameter', but it does not have [ParameterAttribute] applied.

This is a breaking change because prior to the recent changes, component parameters annotated with both attributes could receive values directly without throwing an exception.

This PR fixes the issue by allowing [Parameter] and [SupplyParameterFromQuery] to both exist on a single property without causing an exception to be thrown. If both direct and cascading parameter values are supplied, the direct parameter value is preferred.

Fixes #48937

Customer Impact

Moderate. It's somewhat uncommon to need to do this, but the original issue report did mention a component library that was impacted by this change.

Regression?

  • Yes
  • No

Regressed from .NET 8.0 Preview 5

Risk

  • High
  • Medium
  • Low

This is a straightforward change in a well-tested area, and new tests have been added to verify that the fix works correctly.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

…ParameterFromQuery]` to receive values directly (#48954)
@MackinnonBuck MackinnonBuck added area-blazor Includes: Blazor, Razor Components ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. labels Jun 26, 2023
@MackinnonBuck MackinnonBuck requested a review from a team as a code owner June 26, 2023 20:39
@mkArtakMSFT mkArtakMSFT added Servicing-consider Shiproom approval is required for the issue and removed ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. labels Jun 26, 2023
@ghost
Copy link

ghost commented Jun 26, 2023

Hi @MackinnonBuck. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Jun 26, 2023
@ghost
Copy link

ghost commented Jun 26, 2023

Hi @MackinnonBuck. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

Copy link
Member

@mkArtakMSFT mkArtakMSFT left a comment

Choose a reason for hiding this comment

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

Thanks @MackinnonBuck.
Approved based on the earlier approval of the original PR.

@wtgodbe wtgodbe enabled auto-merge (squash) June 26, 2023 23:12
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jun 26, 2023
@wtgodbe wtgodbe merged commit 815d19d into release/8.0-preview6 Jun 26, 2023
@wtgodbe wtgodbe deleted the mbuck/backport-48954 branch June 26, 2023 23:41
@ghost ghost added this to the 8.0-preview6 milestone Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants