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

JSON deserialize exception when importing migrated Blocklist data over legacy Nested Content #632

Open
BarryFogarty opened this issue Apr 24, 2024 · 4 comments

Comments

@BarryFogarty
Copy link

I am migrating legacy v8 Nested Content to BlockList v13. Datatypes import fine, however the following error is generated when importing content:

Error: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Umbraco.Cms.Core.Models.Blocks.BlockValue' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', line 1, position 1.

Interestingly this only seems to affect unpublished content items. It seems to be a reasonably recent regression as importing the same files to a v12.3.9 (with uSync 12.2.3) is not affected.

NB I am importing on top of an existing database, in order to maintain user permission config. I will try on a fresh DB but I believe it is not affected by this issue. Perhaps uSync is first attempting to deserialize the Nested Content data held in the blocklist property in this context, rather than simply overwriting it.

@KevinJump
Copy link
Owner

Hi,

Have you used uSync.Migrations to Generate the migrated files ? or have you done that another way.

@BarryFogarty
Copy link
Author

BarryFogarty commented Apr 24, 2024

Hi Kevin - yes I generated a sync pack on the v8 site with a Packer. Then used uSync.Migrations on the v13 target site to generate the files. The migration part works fine, the failure happens on an in-place import. It is something to do with the unpublished state. The error does not occur when I edit a generated file to <Published Default="true" />

@KevinJump
Copy link
Owner

hi if you can send us the file i'll see if i can spot anything (kevin@jumoo.co.uk).

@psmoq
Copy link

psmoq commented Apr 29, 2024

I can confirm above behavior. Generated config files (uSync.Migrations) contain properly migrated values (blocklists instead of nested content in my case). However it fails during the import (same exception as above). Downgrade to v12 fixes the problem.

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

No branches or pull requests

3 participants