abp icon indicating copy to clipboard operation
abp copied to clipboard

Clicking Features causes Blazor page to blow up

Open sturlath opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Go to https://localhost:44307/saas/host/tenants as host admin and click on features for a tenant and get the following exception.

[14:42:45 WRN] Unhandled exception rendering component: Unable to evaluate index expressions of type 'PropertyExpression'.
System.InvalidOperationException: Unable to evaluate index expressions of type 'PropertyExpression'.
   at Blazorise.Utilities.ExpressionFormatter.FormatIndexArgument(Expression indexExpression, ReverseStringBuilder& builder)
   at Blazorise.Utilities.ExpressionFormatter.FormatLambda(LambdaExpression expression, String prefix)
   at Blazorise.Utilities.ExpressionFormatter.FormatLambda(LambdaExpression expression)
   at Blazorise.Select`1.GetFormatedValueExpression()
   at Blazorise.BaseInputComponent`1.get_NameAttributeValue()
   at Blazorise.Select`1.<BuildRenderTree>b__56_0(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
[14:42:45 ERR] Unhandled exception in circuit 'vNe_BunHVPTypiw1VOtLm_evJguCsE46o2MN3z-MSP0'.
System.InvalidOperationException: Unable to evaluate index expressions of type 'PropertyExpression'.
   at Blazorise.Utilities.ExpressionFormatter.FormatIndexArgument(Expression indexExpression, ReverseStringBuilder& builder)
   at Blazorise.Utilities.ExpressionFormatter.FormatLambda(LambdaExpression expression, String prefix)
   at Blazorise.Utilities.ExpressionFormatter.FormatLambda(LambdaExpression expression)
   at Blazorise.Select`1.GetFormatedValueExpression()
   at Blazorise.BaseInputComponent`1.get_NameAttributeValue()
   at Blazorise.Select`1.<BuildRenderTree>b__56_0(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

So this image

results in this image

Reproduction Steps

Since I´m unable to login to open source abp.io as seen here https://discord.com/channels/951497912645476422/951497912645476425/1277291221274071183 I can´t replicate it there (if that is even possible) and my commercial subscription has expired and I can´t report it anywhere except here.

I have reported this to Blazorise here https://github.com/Megabit/Blazorise/issues/5714

This happens to newly created tenants as the old ones.

Expected behavior

Being able to click Features dropdown and edit the features of a tenant.

Actual behavior

The Blazor page gets an error and is unresponsive after.

Regression?

Yes this was working before updating

Known Workarounds

None

Version

8.2.2

User Interface

Blazor Server

Database Provider

EF Core (Default)

Tiered or separate authentication server

Tiered

Operation System

Windows (Default)

Other information

No response

sturlath avatar Aug 25 '24 15:08 sturlath

hi

This doesn't seem to be related to abp. We will wait for Blazorise's response.

maliming avatar Aug 26 '24 01:08 maliming

@maliming please take a look at the answer from Blazorise. Could you give them some feedback?

This is totally braking my 8.2 version and would be terrible if I would need to downgrade Blazorise and not be able update it.

sturlath avatar Aug 26 '24 18:08 sturlath

Can you share a simple project to reproduce?

maliming avatar Aug 27 '24 09:08 maliming

No I can´t because I don´t have access to the professional version anymore. What happens if you create a new solution and update the Blazor package, and open the menue on the tenant tab?

sturlath avatar Aug 31 '24 08:08 sturlath

Could this be the case? https://github.com/dotnet/aspnetcore/issues/56145#issuecomment-2183968627

I found that <input @bind="@Data["Stock"]" /> works, but not the @bind-Value.

Could you share the code that you are using for the Features action in the dropdown?

sturlath avatar Sep 01 '24 07:09 sturlath

The dropdown will open FeatureManagementModal.

https://github.com/abpframework/abp/tree/dev/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components

maliming avatar Sep 02 '24 00:09 maliming

@maliming can you take a look at their answer https://github.com/Megabit/Blazorise/issues/5714#issuecomment-2324182894

It seems that you are using some Blazor limitation there that might be easy to fix on your end 🤷‍♂️

it might work by just using the SelectedValue and SelectedValueChanged parameters separatedly, if the SelectedValueExpression part is not needed. (The expression parameter is usually used for validation purposes as far as I personally know.)

sturlath avatar Sep 02 '24 09:09 sturlath

@EngincanV @maliming is this not something that could get into next patch?

Or can I maybe just override it.. (Ill check that)

sturlath avatar Sep 04 '24 06:09 sturlath

We will check this when we upgrade blazorise to 1.6.x.

maliming avatar Sep 04 '24 06:09 maliming

https://github.com/abpframework/abp/pull/20960/commits/376f57d6e9f6fd8308baee4dbb2d167f04d6c610

maliming avatar Oct 04 '24 07:10 maliming