While upgrading to DD4T 2.0, there were some issues/bugs I have encountered – some of them quite obvious, some are tricky and some really drives me crazy – Below is a list of few of them and the resolution which worked for me:
- Installing DD4T 2.0 Templates in a CMS Instance:
While installing the DD4T 2.0 templates using the installer available on DD4T website, it always through below error:
Product: DD4T Templates -- Error 1001. Error 1001. Unable to upload the DD4T Templates into SDL Tridion. Please verify your input. Error: The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.
This issues happens in the scenario when the CM database is being restored from some other environment. Also, this applies to not only installing the DD4T TBBs but also for any Custom TBBs referring the DD4T TBBs.
- Open the Tridion CM database in SQL Server Management Studio
- Locate the table –
Queue_Consumerand open it in edit mode
- Mark status of all other hosts from online to offline – you need to update the field value
IS_ONLINEto 0 for all hosts other than your current host machine.
- Using Component Factory in DD4T 2.0
ComponentFactory in DD4T 2.0 is marked as “deprecated” but the code (which is working fine till DD4T 1.31) does not work while using ComponentFactory in DD4T 2.0.
The ComponentFactory has been marked as deprecated but all the method in the class are throwing “Not Implemented” exception.
This has been raised as a bug with DD4T team and can be followed here – Issue 79
Use Component Presentation Factory instead of Component Factory. If you need to get an IComponent object, then you can use
- Using already published Xml Format DCP with your updated DD4T project
You can use the Xml Format DCP (published through older version of DD4T) with your DD4T 2.0 APIs; however, depending on your Content Delivery code, after update to DD4T 2.0, you might get below error:
Object reference not set to an instance of an object
In the ContentModel.cs class, quite a few numbers of attributes related to Metadata and Keywords are decorated with [XmlIgnore]. Due to this, while you try to Xml Deserialized, you will receive these XmlIgnored attributes as null.
This has been raised as a bug with DD4T team and can be followed here Issue 80
You may either need to wait for this issue to be fixed by the DD4T team or you can take the latest code for the DD4T.Model package, update the ContentModel.cs class in it to remove the [XmlIgnore] attributes. Create a fresh DD4T.ContentModel.dll and replace it in the DD4T.Model package in your project.
NOTE: If you restore your package from nuGet again, it may overwrite your solution.
- Publishing with Custom TBBs referring the DD4T TBBs
In case you have some custom TBBs written for your specific business need and it is expecting the XML format to manipulate with, the publishing will fail in “Rendering” phase
The DD4T 2.0 does not produce the XML format output but only JSON format instead.
Update your custom TBBs such that it does not depends and manipulate the XML format content but accets and work with the JSON format.