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

Upgrade from 10.5.2 to 13.0.1 breaks Form Entries #1157

Closed
AaronSadlerUK opened this issue Feb 1, 2024 · 3 comments
Closed

Upgrade from 10.5.2 to 13.0.1 breaks Form Entries #1157

AaronSadlerUK opened this issue Feb 1, 2024 · 3 comments
Labels
release/12.2.3 release/13.0.2 state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks type/bug

Comments

@AaronSadlerUK
Copy link

AaronSadlerUK commented Feb 1, 2024

It's possible to upgrade Umbraco Forms with existing entries from 8.13.13 to 10.5.2, however the Entries blade fails to load after upgrading from 10.5.2 to either 13.0.0 or 13.0.1

The below exception is thrown in the network tab:

    "ExceptionMessage": "Object reference not set to an instance of an object.",
    "ExceptionType": "System.NullReferenceException, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e",
    "StackTrace": "   at Umbraco.Forms.Core.Models.Form.ApplyDictionaryTranslationsToPrevalueCaptions(IDictionaryHelper dictionaryHelper)\r\n   at Umbraco.Forms.Web.Editors.FormController.GetWithWorkflowsByGuid(Guid guid, Boolean applyDictionaryTranslations)\r\n   at lambda_method834(Closure, Object, Object[])\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"
}

It is possible to view on the website frontend, complete and edit in the backend however not view any of the entries in the backoffice.
All workflows run to completion with no errors.


This item has been added to our backlog AB#37553

@AaronSadlerUK
Copy link
Author

Just an update to save that by Re-Saving the forms I can now view the entries...

So something between 10 and 13 doesn't seem to be running correctly, are there schema or table changes?

@AndyButland AndyButland added type/bug state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks labels Feb 2, 2024
@AndyButland
Copy link

I've had a look into this and whilst I couldn't replicate from an upgrade, I could from the stack trace you shared see where the error was occurring. It seems there's a collection - for prevalues on a field - that we are expecting to be empty, but is in fact null. The data comes from what's stored in the database for the form definition, so although we are always saving empty collections, it looks like at least in some earlier versions it was possible to save a null value. And when we deserialize, even though the property is marked as not being nullable, it can be.

I can replicate it by manipulating the data in the database field - setting "preValues":null in UFForms.Definition - and see what you have seen.

The fact that you see the problem go away once the form is resaved corroborates this (as then an empty, non-null value, is saved).

A null check will be added to the next patch releases to ensure this doesn't occur moving forward.

@AaronSadlerUK
Copy link
Author

Brilliant, thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/12.2.3 release/13.0.2 state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks type/bug
Projects
None yet
Development

No branches or pull requests

2 participants