Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird Taxonomy migration issue (1.6 to 1.7.2) in Orchard CMS

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!

like image 808
AnimaSola Avatar asked Nov 11 '22 15:11

AnimaSola


1 Answers

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

like image 144
Twisted Whisper Avatar answered Dec 05 '22 05:12

Twisted Whisper