Jumoo / Our.Umbraco.MaintenanceMode

Put Umbraco Into Maintenance Mode - While you do things
14 stars 8 forks source link

Dashboard broken where JSON.NET serializer settings set to CamelCase (v2) #36

Closed deenairn closed 1 year ago

deenairn commented 1 year ago

Spend a bit of time configuring this plugin, including upgrading the github project from 8.6.1 to 8.18.5, before finding that the problem was that in our Umbraco 8.18.5 configuration we have JSON.NET configured to be camelCase not PascalCase. We cannot easily change this as all our other clients expect this format, however I cannot think of a nice way to use this utility other than changing all the Angular JS controller bindings locally - this does work, but is a bit nasty.

Is there anyway that the JSON serializer settings can be applied only for this utility? (I am guessing no - I cannot think of any...). Will this also be a problem for v9 and v10?

KevinJump commented 1 year ago

Thanks, fixed in 2.0.1

its a lot less likely to be a problem in v9/10 because Umbraco's middleware controls more of the serialization settings, but i think we will add the attributes to the classes just to make sure.

deenairn commented 1 year ago

Thanks @KevinJump - that's brilliant. I'll give it a check later on today or tomorrow.

What would it take to publish it as a nuget package? Happy to do the donkey work if it's just create a .nuspec file, but would need to know what you're looking for as obviously I won't have publish rights.

KevinJump commented 1 year ago

Yeah - we do push the v10/11 ones as nuget. but they are using the new project format.

i suppose there are two ways.

to be honest i would think a .nuspect would be fine.

If you put a pr in i will build it and publish it.

deenairn commented 1 year ago

I'll give the new project format a bash, I've done this several times before and will mean I can set all the attribute values to identical ones to the v9 and v10 ones. I know it has problems with ASP.NET though so I will not be touching the test site :). If this fails or is too much hassle will do the nuspec.