5
votes

crosspost: https://orchard.codeplex.com/discussions/484033

I'm migrating from Orchard CMS 1.6 to 1.7.2. To give some background, I've hurdled a prior issue before migrating terms in taxonomies by updating the tables:

UPDATE Contrib_Taxonomies_TermPartRecord
SET Path = '/' + Path
WHERE Path NOT LIKE '/%'

UPDATE Contrib_Taxonomies_TermPartRecord
SET Path = '/'
WHERE Path IS NULL

So I've got some content types which have some taxonomies associated to them.

  1. I can create new Content Items without associated taxonomy terms (selecting nothing)
  2. I can create new Content Items with some specific terms only (haven't seen a pattern in the terms)
  3. I can't create/save/publish new Content Items associated to some specific terms (page just tries to load and it's like there's an infinite loop in the background)

Worst part is that no errors are thrown or logged, even in debug mode.

Anyone have any ideas or leads? Has anyone encountered similar behavior before?

Thanks!

2

2 Answers

1
votes

This issue has already been raised here.

I think the Taxonomy module used in version 1.7.2 has an extra linkage between the Container (Taxonomy) and the Term but wasn't implemented properly during the migration of older versions.

The broken linkage caused an infinite loop (please refer to the hyperlink above) when publishing a content item containing the affected term (I didn't encounter any problem saving it, only when publishing).

The linkage can be fixed easily by running the SQL statement below against the database:

UPDATE
    Common_CommonPartRecord
SET
    Container_Id = Orchard_Taxonomies_TermPartRecord.TaxonomyId
FROM
    Common_CommonPartRecord
    INNER JOIN Orchard_Taxonomies_TermPartRecord ON
        Common_CommonPartRecord.Id = Orchard_Taxonomies_TermPartRecord.Id

The SQL statement will take the TaxonomyId from the table Orchard_Taxonomies_TermPartRecord and fill it into *Container_id* of the table Common_CommonPartRecord

0
votes

I managed to find a workaround for this issue, and in case anyone wants it, here is what I did:

  1. List affected Taxonomy terms
  2. Add new terms to replace affected ones
  3. Map old terms to new ones (main table is Orchard_Taxonomies_TermPartRecord, join with Title_TitlePartRecord and Orchard_Framework_ContentItemRecord)
  4. Update Orchard_Taxonomies_TermContentItem records (maps Content Items tagged with terms) to replace old terms with new
  5. Delete old affected terms
  6. Rename new terms to old affected ones

It's a tedious and meticulously delicate process, so I suggest you do it as a last resort. Took me around an hour.