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

Embedded Fields invalid typeOf in PublishingMapping.cs #12

Open
dmandava opened this issue Mar 23, 2018 · 0 comments
Open

Embedded Fields invalid typeOf in PublishingMapping.cs #12

dmandava opened this issue Mar 23, 2018 · 0 comments
Labels

Comments

@dmandava
Copy link

DXA 1.6

Problem
TypeOf is not getting extracted out if we add a typeOf for an embedded schema.
e.g. embeddedTypeOf returns tri:Content,ads:Article instead of tri:Content, ads:Article.

Existing code
PublishingMappings.cs Line 343
ApplicationData appData = embeddedSchema.LoadApplicationData(TypeOfAppDataId);
if (appData != null)
{
embeddedTypeOf += "," + Encoding.Unicode.GetString(appData.Data);
}

Solution
We have to extract typeOf and then add ',' separated values of typeOf.

       ApplicationData appData = embeddedSchema.LoadApplicationData(TypeOfAppDataId);
            if (appData != null)
            {
                string typeOfAppData = ExtractTypeOfAppData(appData);
                if (!string.IsNullOrEmpty(typeOfAppData))
                {
                    embeddedTypeOf += "," + typeOfAppData;
                }
            }
@rpannekoek rpannekoek added the bug label Dec 18, 2018
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

2 participants