Comments (11)
@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.
// pinging @Jeavon in on this, in case he has any thoughts on the topic.
from umbraco-ditto.
@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.
@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.
@leekelleher ah no, it's Ditto v0.7.0, am I going to need a empty constructor for v0.8.0+?
from umbraco-ditto.
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.
Ok, don't see why adding empty constructor would be a issue...?
from umbraco-ditto.
@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.
@leekelleher I just tried it out and added Ditto to the UCPVC test site and it "just worked" so I'm not sure...?
from umbraco-ditto.
@Jeavon Oooo cool! 😎 (Thanks for testing it out)
I guess we need @bluefindigital to clarify the issue he experienced?
from umbraco-ditto.
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.
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)
- DittoCache examples HOT 2
- Changes to lazy properties HOT 7
- Documentation using GitHub Pages HOT 2
- How to bind my model with an action to a DitFloView PartialView HOT 22
- UmbracoPicker returns wrong IPublishedContent in Umbraco 7.5.3 HOT 7
- Base Processor - exposing Umbraco context services HOT 5
- Custom Processor Contexts only persist a single .As() HOT 18
- Ditto Factory misusing `PluginManager.ResolveTypes`? HOT 10
- Ability to Conditionally Stop Processor Chain HOT 24
- XPath Processor? HOT 6
- Decimal mapping always 0 for negative values HOT 7
- Constructor Cache is no longer used HOT 3
- Orphaned Archetype Properties Cause Null Exception During Mapping HOT 3
- Migration to UMCO HOT 1
- Ditto-centric Stack Trace HOT 4
- Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found. HOT 36
- Support for Umbraco v8 HOT 1
- Getting EntryPointNotFoundException on ditto objects HOT 2
- Excessive memory usage HOT 9
- Casting IPublishedContent to specific Model using Ditto mixing up property values between nodes on the same level HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umbraco-ditto.