9

I have a DXA 1.7 Web Application and have a problem with some fields being mapped and the Model being populated, but a couple fields are not mapped. They are embedded fields and are null when the page is loaded.

How is it possible to receive more debug info on why the field is not being mapped and populated?

I have confirmed the published JSON does contain the content, and the fields in the Model class match the fields in the Schema. Also, another embedded field maps fine, as well as the text fields.

Update: The field name that was null is more than 32 characters and this appears to be the issue for the null field value. Renaming the XML Fieldname in the parent Schema to a shorter name works. But, this is not what we want, as renaming the XML Name will result in content loss.

I am still curious how to debug this one and get the error about it not serializing the field due to a length constraint.

However, I have posted another question regarding the field length here.

5

Although not sure if this can help, but you may check by generating Trace log for your web application. I would prefer to debug issue by referencing the codebase instead of compiled dll. Definition of model binding logic is available in the method BuildEntityModel present in DefaultModelBuilder class present at code url.

In case of any customization required, you can create you own Model Builder class and override BuildEntityModel. DXA provides a good way to extend and customize the code according to client requirement. Recently, I have worked on a project where we have extended many features of DXA.

  • Indeed, setting DXA log level to DEBUG (or TRACE) should give you quite some diagnostic info about semantic mapping in your DXA log file. – Rick Pannekoek Sep 6 '17 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.