Bug 793885 (JBEPP-958)

Summary: UIFormCheckBoxInput.setValue() doesn't parse String
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: PortalAssignee: hfnukal <hfnukal>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.1.0.GA, 5.1.1.DEV01CC: epp-bugs, tkobayas
Target Milestone: ---   
Target Release: 5.1.1.DEV02   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEPP-958
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-07 14:55:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 793886    
Attachments:
Description Flags
exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782
none
JBEPP-958.patch none

Description Toshiya Kobayashi 2011-05-24 14:35:25 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000006Iqry&sbstr=00418872&sfdc.override=1
project_key: JBEPP

If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.

{noformat}
   public UIFormInput setValue(T value)
   {
      if (value == null)
         return super.setValue(value);
      if (value instanceof Boolean)
      {
         checked = ((Boolean)value).booleanValue();
      }
      else if (boolean.class.isInstance(value))
      {
         checked = boolean.class.cast(value);
      }
      typeValue_ = (Class<T>)value.getClass();
      return super.setValue(value);
   }
{noformat}

The caller may be changed to pass a Boolean but fixing UIFormCheckBoxInput to parse a String would be an essential resolution.

Actually org.exoplatform.ecm.webui.component.explorer.popup.admin.UIPropertyForm in WCM(Site Publisher) is hitting this issue.

How to reproduce(EPP 5.1.0 + SP 2.1.2):

1. Rename attached exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782 to exo-ecms-core-webui-explorer-2.1.2.jar and copy it to $JBOSS_HOME/server/$PROFILE/deploy/gatein-wcm-extension-2.1.2.ear/lib (This patch helps to reproduce the issue. It doesn't affect the issue itself)
2. Start EPP with SP(ecmdemo)
3. Go to Content Explorer and click "Add Folder" to create a folder 'test' under '/acme'
4. Select 'test' and click "System" > "View Node Properties". Go to "Add New Property" tab. Set Name="testprop", Type="Boolean", Multiple="false" and check "Value" checkbox. Save.
5. You can confirm "testprop" is 'true' in "Properties" tab
6. Click 'Edit' icon in 'Action' column of "testprop"
- You will see "Value" checkbox is unchecked

Comment 1 Toshiya Kobayashi 2011-05-24 14:45:02 UTC
Attachment: Added: exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782


Comment 3 Toshiya Kobayashi 2011-05-24 14:49:25 UTC
Attachment: Added: JBEPP-958.patch


Comment 4 Toshiya Kobayashi 2011-05-24 14:50:21 UTC
Attached JBEPP-958.patch

Comment 5 Toshiya Kobayashi 2011-05-24 14:58:03 UTC
Link: Added: This issue incorporates GTNPORTAL-1910


Comment 6 Toshiya Kobayashi 2011-05-24 15:07:01 UTC
Link: Added: This issue is a dependency of JBEPP-959


Comment 7 hfnukal@redhat.com 2011-06-07 14:55:53 UTC
Release Notes Text: Added: If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.
Fixed by recognizing string and converting to boolean value.


Comment 8 Scott Mumford 2011-08-09 04:04:06 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Release Notes Text: Removed: If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.
Fixed by recognizing string and converting to boolean value. Added: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behaviour has been corrected by recognizing string values when entered and converting them to boolean values.


Comment 9 Scott Mumford 2011-08-23 05:03:28 UTC
Release Notes Text: Removed: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behaviour has been corrected by recognizing string values when entered and converting them to boolean values. Added: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behavior has been corrected by recognizing string values when entered and converting them to boolean values.