Issue with Mediachase.Commerce.Catalog -> ReferenceConverter -> GetContentLink(string code) method after Epi Upgrade v9 to v12


I was hoping that someone might be able to provide some insight.  Recently we upgraded from version 9 to version 12 of Epi Commerce.  We have some custom code that pulls Catalog Entries and Catalog Nodes via the Reference Converter -> GetContentLink(string code) method.  In version 9 this method would return either the catalog entry or node record; respectively based on the passed code. 

This still works perfectly for the catalog entry; however for the catalog node we are now getting back an arbitrary record with an insanely high ID ... (i.e. ID = 1073773293, WorkID = 0, ProviderName = "CatalogContent")... This record does not correspond to any record in the database.  The record I would expect to get back has a CatalogNodeId of 31465 (I verified that it is present in the database)

We instead tried to use the overload that takes a CatalogContentType; but found the same result.  Upon digging; the only reference we could find to this ID was in the EpiServer database (in theBigTable) with the Indexed_Integer01 property.

Any input would be appreciated!

Edited, Jun 21, 2018 14:40

That is the correct value and it has been that way since 7.5. The ContentId 1073773293 does not have to correspond with an ObjectId (31465 in this case).

I'd suggest you to forget about the ContentId and just use the entire ContentReference. The system know to how to identify a node or an entry from a ContentReference.

I explained it in my book if you want some technical details 

Jun 21, 2018 15:31

Asweome, thanks Quan ... I'll give that a shot!

Jun 21, 2018 15:34

@Quan Mai - So upon a bit further evaluation; we are using the entire ContentReference to the Association Links UpdateAssociations(IEnumerable<Association> associations) for Target/Source .... but the error we get back is this .... "Association Target must be a Catalog Entry"?

Modifying the ID in the immediate window with the actual node id allows the save to proceed successfully.

Edited, Jun 21, 2018 15:44
<p>You just can't add an association to a Node, that is all. Associations are between entries and entries. If you want to add a node-entry relation you would have to use IRelationRepository</p>
Jun 21, 2018 18:08

Thanks Quan; that was my issue.  Old code that worked in the old version of Epi.  Swapped out of IRelationrepository; and all is good in the world!  Thanks so much for your help.  For some reason the Forum won't let me mark your answer.

Jun 22, 2018 18:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.