-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
resolveuid deserializer doesn't handle lists or nested dicts #1594
Comments
The current situation is that you can implement an IBlockFieldDeserializationTransformer adapter to do it for the specific blocks and fields where it is needed. For example plone.volto has one that handles fields named The idea of handling this generically might be okay as long as: I would feel better if it were based on a block schema so that we could do it only for the fields that we know are referencing object paths, rather than using a heuristic based on field name. |
@davisagli Fairly new to using the block transforms so forgive me for any lack of understanding:
This is my biggest concern with the change. There's an initial PR linked to this issue if anybody wanted to test this against their bigger blocks
While the actual data would change, a
Completely agreed. However, we don't really have the notion of a URL field right? The only hint is the widget in the frontend when using Volto. Would we need some kind of formal schema (e.g. #923 or plone/volto#2252) support for blocks to achieve this? For more specific use cases, I agree that it's probably best to have specific adapters for more specific use cases, but I image most sites would want |
@JeffersonBledsoe I will try to take another look at this during the Beethoven Sprint. I'm not too worried about the performance impact or backwards compatibility, and it would certainly help avoid the need for lots of custom adapters. I also have an idea about storing some information during resolveuid deserialization to be used by the linkintegrity retriever instead of walking the blocks again, which could help recuperate any loss of performance. One important note: we need a similar change to the serializer to make sure the resolveuid URLs actually get resolved when getting blocks content. |
The resloveuid deserializer currently makes the assumption that the
url
orhref
field is in the root of the block data, or it has been created by a volto_object_browser that is set tosingle
mode. This means that making use of nested or lists of block data or lists (such as with theobject_list
widget in Volto) doesn't cause the field to be converted to useresolveuid
.For example, the following block data:
Should end up being stored as this:
But instead is saved as in the original
The text was updated successfully, but these errors were encountered: