Bug 2231377

Summary: Guided entry overwrites supplied comment
Product: [Community] Bugzilla Reporter: Radek Vykydal <rvykydal>
Component: Creating/Changing BugsAssignee: Jeff Fearn 🐞 <jfearn>
Status: RELEASE_PENDING --- QA Contact: Jeff Fearn 🐞 <jfearn>
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.0CC: jfearn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Radek Vykydal 2023-08-11 13:00:33 UTC
Created attachment 1983008 [details]
Page source dump.

Description of problem:

When we enter a BZ for anaconda component with this URL:

https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&version=rawhide&component=anaconda&short_desc=SHORT_DESC&comment=COMMENT

the value of Details textarea "COMMENT" is overwritten by ''

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

5.0.4.rh89
I think some weeks ago we didn't hit this problem.

How reproducible:

always

Steps to Reproduce:
1. https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&version=rawhide&component=anaconda&short_desc=SHORT_DESC&comment=COMMENT
2. See that the Details text area does not contain the 'COMMENT' value
3.

Actual results:

Empty Details / "#comment" textarea.

Expected results:

The "COMMENT" string is kept.

Additional info:

We are going to use the URL for bug reporting from Anaconda installer via opening the link.

If we don't specify the component:
https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&version=rawhide&short_desc=SHORT_DESC&comment=COMMENT
the Details is not overwritten.

Seems that the value is overwritten by get_def_templ function (`comment.val('').data('changed', false);`):

function get_def_templ(name) {
    if (name === "") return;
    new Rpc("Component", "get", {
            names: [{
                component: name,
                product: 'Fedora'
            }]
        })
        .done(function (result) {
            if (result.components[0].template_id == 1) {
                var comment = $("textarea[name=comment]").first();
                if (comment.data('changed')) {
                    if (!confirm("This will overwrite your changes in the description. Continue?")) return;
                }
                comment.val('').data('changed', false);
                $('.basic_info').removeClass('bz_default_hidden');
            } else {
                $('.basic_info').addClass('bz_default_hidden');
                $('#bvp_t_' + result.components[0].template_id).click();
            }
        });
}

function PutDescription() {
    $('#' + get_def_templ($("#component").val()));
    var $sel = $("#component").selectize()[0].selectize;
    if ($sel &amp;&amp; $sel.getValue()) {
        $("#description").html($sel.options[$sel.getValue()]['title']);
    }

Maybe we need to update some data configuration for 'anaconda' component?

Comment 1 Radek Vykydal 2023-08-11 14:12:25 UTC
Jeff, is this even the right place to file the BZ on rh-bugzilla ?

Comment 2 Jeff Fearn 🐞 2023-08-14 00:15:41 UTC
Hi, I have moved this to the current sprint. This is _the_ place to open bugs for rh-bugzilla :)

Comment 3 Jeff Fearn 🐞 2023-08-15 03:59:27 UTC
ON QA server:

1. follow link to form

All supplied fields are set as expected.

2. Change component.

Warning is triggered that changing component will change the description is shown.

Comment 4 Jeff Fearn 🐞 2023-08-15 04:22:50 UTC
This fix has been deployed to stage Bugzilla for a short public testing phase.

https://bugzilla.stage.redhat.com

Comment 5 Radek Vykydal 2023-08-15 07:55:40 UTC
(In reply to Jeff Fearn 🐞 from comment #4)
> This fix has been deployed to stage Bugzilla for a short public testing
> phase.
> 
> https://bugzilla.stage.redhat.com

Works for me as expected. Thank you!