3

When calling:

DD4T.Factories.ComponentFactory.GetComponent(componentUri);

The metadata values, for a component added as a component link to the parent component associated with the componentUri above, is not returned with the above call. What could be causing this? The field values for the linked component are returned, but for some reason the metadata is not.

4
  • Do you get the metadatafields if you retrieve the linkedcomponent itself? Maybe you have to publish the linkedcomponent? Feb 20, 2017 at 8:27
  • When I try to get the linked component itself I get: Error in the application. "'DD4t.ContentModel.Exceptions.ComponentNotFoundException' occurred in DD4T.Factories.dll". I've also tried publishing the linked component, but it doesn't seem to make any difference unfortunately. Feb 20, 2017 at 9:33
  • That means the component is not in the broker. Does that component have a component template which has the same schema linked? Feb 20, 2017 at 9:48
  • But I think you have to increase the LinkLevel on the component template of the parent component. Try to increase that till you see the fields. Feb 20, 2017 at 9:49

1 Answer 1

2

The problem was that the component hadn't been saved back after schema changes, as the pre-populated default values in the data were not saved back prior to publishing. Hence, publishing out the component only published out the old version of the component.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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