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

Too many XmlIgnore attributes on ContentModel classes #80

Open
quirijnslings opened this issue May 25, 2016 · 3 comments
Open

Too many XmlIgnore attributes on ContentModel classes #80

quirijnslings opened this issue May 25, 2016 · 3 comments
Labels

Comments

@quirijnslings
Copy link
Member

In Field:
[XmlIgnore]
public List Keywords
{
get
{
return KeywordValues;
}
set
{
KeywordValues = value;
}
}

Careful: there may be more examples of this in the ContentModel.cs!

@anatolii-lysenko
Copy link

anatolii-lysenko commented May 31, 2016

Hello,

I've started with dd4t 2.0 upgrade and found out a bug that breaks backward compatibility. It reproduces only in case of 2 or more TBBs in template. In 1.31 in Field class of ContentModel dll there was Keywords list property and in 2.0 version that property wraps another KeywordValules property. During serialization/deserialization process XML changes and Keywords collection remains empty. So instead of <Keywords><Keyword> ... </Keyword></Keywords> the following is rendering <KeywordValues />

I've tried to remove XmlIgnore from KeywordValues property and got the XML that contains keywords information but with new node names.

Looking into removing KeywordValues property and leaving only Keywords one and refactoring all the projects to use it.

Regards,
Anatolii Lysenko

@code-monkee
Copy link

This is an urgent issue for me as well. Looking at Anatolli's comment, I attempted to simply remove the [XMLIgnore] annotation from

    [XmlIgnore]
    public List<Keyword> Keywords
    {...}

    [XmlIgnore]
    IList<IKeyword> IField.Keywords
    {...}

    [XmlIgnore]
    IList<IKeyword> IField.KeywordValues
    {...}

This seemed to work. Is they any further issues that this could possibly cause? Should I submit this as a pull request? Hoping to avoid having to think about going into production with a customized version of a DD4T library.

As a sidenote when trying to build the DD4T.Model solution from the released version, I found that there is a circular reference between DD4T.ContentModel and DD4T.Serialization. Not sure if this has been fixed in alpha versions. I cut and pasted a dll from my already downloaded nuGet package to encourage it to build.

Let me know if there's any further help I can provide.

Jason Kaufmann

@anatolii-lysenko
Copy link

Hi Jason,
Another issue you may find is DCPs. New version requires all the DCPs published as CP and not just component. In PageFactory.LoadComponentModelsFromComponentPresentationFactory
there is a line where ComponentTemplate object is being reassigned. It broke our code in a few places because we use information about CT. I commented it out and everything is working fine now.

Anatolii

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

No branches or pull requests

3 participants