Bug 106406

Summary: broken interface for adding/removing linked categories
Product: [Retired] Red Hat Enterprise CMS Reporter: Vadim Nasardinov <vnasardinov>
Component: uiAssignee: Vadim Nasardinov <vnasardinov>
Status: CLOSED RAWHIDE QA Contact: Jon Orris <jorris>
Severity: medium Docs Contact:
Priority: medium    
Version: nightlyCC: bstein
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-03 17:36:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 106481, 109665    
Attachments:
Description Flags
screenshot showing the broken UI
none
the way it works in 5.2 none

Description Vadim Nasardinov 2003-10-06 20:13:10 UTC
In change 33951, a JavaScript-based UI for category assignment
was added.  This change appears to have broken another (somewhat
related) piece of UI.

Go to the "Categories" tab of the content section page. Select
a category from the tree of categories displayed on the left-hand
side.

Under the "Category details" pane on the right-hand side, there
should be a button that says "Add or remove linked categories".

If you click on this button, you'll get a broken piece of UI:
The box entitled "Available categories" is empty, although it
shouldn't be.  The box is supposed to be populated by a JavaScript
script produced by
//cms/dev/web/packages/content-section/www/generate-category-javascript.jsp

The box is empty because the URL to the above JSP is incorrect.  If you
look at the produced HTML, the value of the "src" attribute is this:
<script language="javascript"
src="generate-category-javascript.jsp?outputType=text/javascript&amp;rootID=&amp;formName=LinkForm"></script>

What should be is something like this:
<script language="javascript"
src="/ccm/content/generate-category-javascript.jsp?outputType=text/javascript&amp;rootID=143&amp;formName=CategoryForm143"></script>

Note that the prefix "/ccm/content/" is missing in the former case.

The offending class is probably com.arsdigita.cms.ui.category.LinkForm.
Compare it to com.arsdigita.cms.ui.authoring.ItemCategoriesForm.

See also //cms/web/__ccm__/static/cms/admin/category-tree/authoring-step.xsl

Comment 1 Vadim Nasardinov 2003-10-06 20:15:46 UTC
Created attachment 94955 [details]
screenshot showing the broken UI

Comment 2 Vadim Nasardinov 2003-11-24 16:59:42 UTC
Created attachment 96153 [details]
the way it works in 5.2

Comment 3 Vadim Nasardinov 2003-11-24 17:07:39 UTC
This is also broken in 6.0 in the same way that it is broken on the
trunk.

The way it used to work in 5.2 is shown in attachment 96153 [details]. 

In 5.2,

 1. Go to the "Content" content section.
 2. Click on the "Categories" tab.
 3. Click on "Industries" (under Root / Business / Industries).
 4. Click on "Edit Links".
 5. Select " Arts/Television" and move it to the right.
 6. Click "Finish".

 The following row has been added to the cat_category_category_map table:

 select * from cat_category_category_map;
  category_id | related_category_id | default_p | sort_key | relation_type 
 -------------+---------------------+-----------+----------+---------------
 ..........................................................................
         1057 |                1061 |           |       29 | child
 (29 rows)

where

select * from cat_categories;
 category_id |     name     |  description  | enabled_p | abstract_p | default_ancestors 
-------------+--------------+---------------+-----------+------------+-------------------
        1021 | /            | Root Category | 1         | 0          | 1021/
        1055 | Arts         | Arts          | 1         | 0          | 1054/1055/
        1057 | Television   | Television    | 1         | 0          | 1054/1055/1057/
        1059 | Business     | Business      | 1         | 0          | 1054/1059/
        1061 | Industries   | Industries    | 1         | 0          | 1054/1059/1061/
.........................................................................................
(32 rows)


Comment 4 Vadim Nasardinov 2003-12-02 22:30:39 UTC
I fixed the regression from 5.2 in change 38432.

The fix merely restores the old pre-6.0 behavior.  I did not try
to make LinkForm use the newfangled JavaScript-based category
tree selection form (ItemCategoriesForm).  So, the end result is
that the "Category assigment" step of the authoring kits uses the
nifty new JavaScript-based UI than Dan added.  The "Add or remove
linked categories" section uses the old UI with multi-select boxes.

I'll open a new ticket for sorting out this JavaScript-based tree
business to make sure we integrate the JavaScript-based widget
throughout CMS.



Comment 5 Vadim Nasardinov 2003-12-02 22:38:14 UTC
Any remaining issues should be posted to bug 111392 (unless
change 38432 introduced new bugs, in which case this ticket
should be reopened).