Giter VIP home page Giter VIP logo

Comments (11)

leekelleher avatar leekelleher commented on July 28, 2024

@bluefindigital Thanks for flagging it up.

The RelatedLinks type isn't from Umbraco core, it's from @Jeavon's PropertyConverter library (ref link).

The issue is that Ditto will try to make a new instance of the RelatedLinks object, but since the constructor requires a parameter, we have no idea what value to pass into it. If the type had an additional parameterless constructor, then it wouldn't be an issue.

https://github.com/Jeavon/Umbraco-Core-Property-Value-Converters/blob/v2/Our.Umbraco.PropertyConverters/Models/RelatedLinks.cs#L44

// pinging @Jeavon in on this, in case he has any thoughts on the topic.

from umbraco-ditto.

Jeavon avatar Jeavon commented on July 28, 2024

@leekelleher @bluefindigital Hmm, I guess the property is empty? I have just had a quick look at a recent project we have used RelatedLinks with Ditto

    public RelatedLinks RelatedPages { get; set; }

from umbraco-ditto.

leekelleher avatar leekelleher commented on July 28, 2024

@Jeavon Thanks for jumping in on this. Do you know if it's Ditto v0.8.0+?

@bluefindigital You mention a DittoValueResolver, do you have a custom one? or do you mean the default (Ditto) UmbracoProperty one?

from umbraco-ditto.

Jeavon avatar Jeavon commented on July 28, 2024

@leekelleher ah no, it's Ditto v0.7.0, am I going to need a empty constructor for v0.8.0+?

from umbraco-ditto.

leekelleher avatar leekelleher commented on July 28, 2024

I'll double check what we changed in v0.8.0. I vaguely recall making a decision with @mattbrailsford about constructor parameters of unknown type, that we'd throw an exception. I have a sneaky feeling that previous we were swallowing the exception. I'll check.

Otherwise, yeah, RelatedLinks would need an empty constructor.

from umbraco-ditto.

Jeavon avatar Jeavon commented on July 28, 2024

Ok, don't see why adding empty constructor would be a issue...?

from umbraco-ditto.

leekelleher avatar leekelleher commented on July 28, 2024

@Jeavon Sorry, I've misread your last reply 😕 - do you mean it's okay to add an empty constructor to RelatedLinks or that it shouldn't need it?


Re: Ditto - I'm a bit confused with what is going on, as the difference between Ditto 0.7 and 0.8 is minimal...

0.7.0 - https://github.com/leekelleher/umbraco-ditto/blob/0.7.0/src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs#L277
0.8.0 - https://github.com/leekelleher/umbraco-ditto/blob/0.8.0/src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs#L277

Following the logic, then trying to map a property (of type RelatedLinks) should have also thrown an exception with Ditto 0.7.0.


@bluefindigital Can you provide any code snippets? (Just for my sanity, more than anything else) 😃

from umbraco-ditto.

Jeavon avatar Jeavon commented on July 28, 2024

@leekelleher I just tried it out and added Ditto to the UCPVC test site and it "just worked" so I'm not sure...?

https://github.com/Jeavon/Umbraco-Core-Property-Value-Converters/blob/v3/TestSite/Views/umbHomePage.cshtml#L96

https://github.com/Jeavon/Umbraco-Core-Property-Value-Converters/blob/v3/TestSite.Logic/Models/Home.cs

from umbraco-ditto.

leekelleher avatar leekelleher commented on July 28, 2024

@Jeavon Oooo cool! 😎 (Thanks for testing it out)

I guess we need @bluefindigital to clarify the issue he experienced?

from umbraco-ditto.

BarryFogarty avatar BarryFogarty commented on July 28, 2024

Sorry guys this turned out to be my mistake. I am trying out Ditflo at the moment and the problem turned out to be how I was trying to resolve a recursive property in a DittoResolver. I was ending up trying to resolve the whole IPublishedContent as RelatedLinks, not the property itself. Apologies, false alarm!

from umbraco-ditto.

leekelleher avatar leekelleher commented on July 28, 2024

No worries @bluefindigital!

I wasn't 100% sure myself. I've added a unit-test to satisfy my curiosity 😃

from umbraco-ditto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.