From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030716 Description of problem: If you create a content item and then change its language, it will no longer appear in the content section browse pane. When a content item is created it is assigned a language. A content bundle is also created and its default language is set to the language on the content item. The SQL query used to select items displayed in the browse pane matches the default language of the bundle with the content item. This is because there may be multiple items with different languages in the same bundle, and you only want to display one of those items. However, because of this, if you change the language on the content items such that none of them match the original language (the bundle's default language) then none of the items appear Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.create a 'foo' article of language english 2.change its language to french 3.go to the content section browse pane Actual Results: 'foo' isn't there Expected Results: 'foo' should be there. However, It's unclear what the correct solution is. One option is to just pull one item from random from the bundle if none of them match the default language. Another option is to prevent the user from getting into a state such that none of the items match the bundle's default language. Additional info:
Here's an initial stab at a modified query that will pull one content item at random to display when non match the default language. --- Folder-queries.ora.pdl 2003-08-01 10:35:30.000000000 -0400 +++ /tmp/Folder-queries.ora.pdl 2003-08-02 13:07:07.000000000 -0400 @@ -255,8 +255,6 @@ i.item_id = a.object_id and i.type_id = t.type_id - and - i.language = b.default_language and i.parent_id = b.bundle_id and @@ -265,6 +263,22 @@ bi.parent_id = :parent and i.version = :version + and + i.item_id = case when exists (select 1 + from cms_items c + where c.language = b.default_language + and c.parent_id = b.bundle_id + and c.version = :version) + then (select c.item_id + from cms_items c + where c.language = b.default_language + and c.parent_id = b.bundle_id + and c.version = :version) + else (select max(c.item_id) + from cms_items c + where c.parent_id = b.bundle_id + and c.version = :version) + end; } map { bundleID = bundle_id; item.id = i.item_id;
Justin & Archit: Need to change bundle's primary language when primary item's language is changed.
Fixed. MLTest verifies