Bug 101524 - ML Content Items can 'disappear'
ML Content Items can 'disappear'
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Justin Ross
Jon Orris
Depends On:
Blocks: 101458
  Show dependency treegraph
Reported: 2003-08-02 12:27 EDT by Dennis Gregorovic
Modified: 2007-04-18 12:56 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-10-14 10:58:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dennis Gregorovic 2003-08-02 12:27:04 EDT
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:

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:
Comment 1 Dennis Gregorovic 2003-08-02 13:08:58 EDT
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
       i.type_id = t.type_id
-    and 
-      i.language = b.default_language
       i.parent_id = b.bundle_id
@@ -265,6 +263,22 @@
       bi.parent_id = :parent
       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;
Comment 2 Jon Orris 2003-08-11 15:17:47 EDT
Justin & Archit: Need to change bundle's primary language when primary item's
language is changed.
Comment 3 Jon Orris 2003-10-14 10:58:43 EDT
Fixed. MLTest verifies

Note You need to log in before you can comment on or make changes to this bug.