Bug 1212470

Summary: DateTime control returns the wrong date/time if the chosen date/time is in less that 1h
Product: Red Hat CloudForms Management Engine Reporter: Fabien Dupont <fdupont>
Component: UI - OPSAssignee: Martin Hradil <mhradil>
Status: CLOSED ERRATA QA Contact: Kyrylo Zvyagintsev <kzvyahin>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3.0CC: cbolz, cpelland, drieden, fdupont, hkataria, jhardy, jocarter, mfeifer, mhradil, mpovolny, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: 5.5.0.10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1277624 (view as bug list) Environment:
Last Closed: 2015-12-08 13:05:40 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:
Embargoed:
Bug Depends On: 1215142    
Bug Blocks: 1277624, 1299611, 1301165    

Description Fabien Dupont 2015-04-16 13:27:03 UTC
Description of problem:
When using a Date/Time control in a custom dialog called from a custom button, the widget returns the wrong date/time if the chosen time in closer than 1 hour to the current date/time. The returned date/time is 13 hours older than selected.

Version-Release number of selected component (if applicable):
5.3.3.2.20150217120931_a465215

How reproducible: always


Steps to Reproduce:
1. Create a custom service dialog with a DateTime control
2. Create a custom button for a VM, pointing to this dialog
3. Launch a method that logs the date/time

Actual results:
If selected date/time is closer than 1 hour to now, the date/time returned is 13 hours older. Otherwise, it is accurate.

Expected results:
Date/time always accurate.

Additional info:
I have applied the patches from https://bugzilla.redhat.com/show_bug.cgi?id=1195877, as the DateTime widget was not working at all.

Comment 8 CFME Bot 2015-11-04 16:23:08 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0f5bc03e64e63e21226e04545ec5ec57db078925

commit 0f5bc03e64e63e21226e04545ec5ec57db078925
Author:     Martin Hradil <mhradil>
AuthorDate: Tue Nov 3 14:46:21 2015 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Tue Nov 3 14:48:45 2015 +0000

    DialogRunner#dialog_get_form_vars - handle DateTime field input in random order
    
    a DateTime dialog has 3 input fields - date, hour and minute
    previously, these needed to be set in that order, otherwise, setting
    date would reset hours and minutes, setting hourse would reset minutes..
    
    Now, a datetime is prefilled with tomorrow at current date and time, and
    remembers changes in any order.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1212470

 .../application_controller/dialog_runner.rb        | 38 +++++++++++++---------
 1 file changed, 22 insertions(+), 16 deletions(-)

Comment 11 CFME Bot 2015-11-06 20:47:32 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=c50a895477d2485caa5d71da4549555c9607adcf

commit c50a895477d2485caa5d71da4549555c9607adcf
Author:     Martin Hradil <mhradil>
AuthorDate: Tue Nov 3 14:46:21 2015 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Fri Nov 6 15:37:57 2015 +0000

    DialogRunner#dialog_get_form_vars - handle DateTime field input in random order
    
    a DateTime dialog has 3 input fields - date, hour and minute
    previously, these needed to be set in that order, otherwise, setting
    date would reset hours and minutes, setting hourse would reset minutes..
    
    Now, a datetime is prefilled with tomorrow at current date and time, and
    remembers changes in any order.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1212470
    (cherry picked from commit 0f5bc03e64e63e21226e04545ec5ec57db078925)

 .../application_controller/dialog_runner.rb        | 38 +++++++++++++---------
 1 file changed, 22 insertions(+), 16 deletions(-)

Comment 12 CFME Bot 2015-11-06 20:47:38 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7becb4e08a8751a2c7036bd30e1ab04a6020e183

commit 7becb4e08a8751a2c7036bd30e1ab04a6020e183
Merge: 1c51490 ad72f73
Author:     Dan Clarizio <dclarizi>
AuthorDate: Fri Nov 6 15:46:25 2015 -0500
Commit:     Dan Clarizio <dclarizi>
CommitDate: Fri Nov 6 15:46:25 2015 -0500

    Merge branch 'bz1212470-55' into '5.5.z'
    
    DialogRunner#dialog_get_form_vars - handle DateTime field input in random order
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1212470
    clean cherry-pick
    
    See merge request !378

 .../application_controller/dialog_runner.rb        | 50 +++++++++++-----------
 .../application_controller/dialog_runner_spec.rb   | 40 +++++++++++++++++
 2 files changed, 64 insertions(+), 26 deletions(-)

Comment 14 errata-xmlrpc 2015-12-08 13:05:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551

Comment 15 eclarizi 2016-02-02 15:22:24 UTC
*** Bug 1286860 has been marked as a duplicate of this bug. ***

Comment 16 John Prause 2016-02-10 18:33:29 UTC
*** Bug 1299611 has been marked as a duplicate of this bug. ***