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

OC throws InvalidOperationException after I upgrated OC from v1.8.4 to v2.1.2 in runtime #17198

Closed
effapp opened this issue Dec 10, 2024 · 3 comments

Comments

@effapp
Copy link

effapp commented Dec 10, 2024

Describe the bug

OC throws InvalidOperationException after I upgrated OC from v1.8.4 to v2.1.2 in runtime

An unhandled exception occurred while processing the request.
InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'OrchardCore.DisplayManagement.Zones.ZoneHolding', but this ViewDataDictionary instance requires a model item of type 'OrchardCore.Users.ViewModels.LoginViewModel'.
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary..ctor(ViewDataDictionary source, object model, Type declaredModelType)

To Reproduce

  1. Go to home page
  2. Go to /admin
  3. Throws InvalidOperationException

Internal Server Error

@Piedone
Copy link
Member

Piedone commented Dec 10, 2024

Do you have a login form-overriding template? Because that changed in 2.0, and you'll need to take the latest source as the baseline for the override: https://docs.orchardcore.net/en/latest/releases/2.0.0/#users-module

@MikeAlhayek
Copy link
Member

I am guessing you have a template overriding the login.cshtml which uses to accept LoginViewModel and now it accepts IShape instead.

Make sure your custom login.cshtml looks like this

@effapp
Copy link
Author

effapp commented Dec 11, 2024

Hi @Piedone @MikeAlhayek ,
Good, I have a login form-overriding template. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants