Admin area Abuse report dialog/modal bug [4.4]

faridadobani5832

New Member
YetiShare User
Mar 28, 2016
17
0
1
Hello Adam,

These is a minor issue in admin area. When a Abuse report is accepted, the acceptReport() function still closes the dialog while it should hide modal. Here's the little code that needs to be changes

Code:
function acceptReport(abuseId)
    {
        gAbuseId = abuseId;
        //  accept report
        $.ajax({
            type: "POST",
            url: "ajax/file_report_accept.ajax.php",
            data: { abuseId: gAbuseId },
            dataType: 'json',
            success: function(json) {
                if(json.error == true)
                {
                    //$('#confirmDelete').dialog('close');
                    hideModal();
                    showError(json.msg);
                }
                else
                {
                    //$('#confirmDelete').dialog('close');
                    hideModal();
                    showSuccess(json.msg);
                    $('#removal_type').val(3);
                    $('#admin_notes').val('');
                    reloadTable();
                    callback();
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                showError(XMLHttpRequest.responseText);
            }
        });
    }
Also, I would like you to notify us even if you have made minor changes in the script. I usually have to download the script and plugins every once in a while (and compare) to check if there are minor changes. Please be a good developer. We need every little bugs to be cleared on our site and you are suppose to notify us even if there is any little change.

Thank You,
Farida Dobani.
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
Hi,

Thanks for pointing this out.

Regards,
Adam.
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
this still did not fix the issue on my site. I have an abuse report and when i click delete, the file actually deletes but the dialog box will still stay... any ideas? i double checked and i have the hidemodal code but no luck..

Code:
    function acceptReport(abuseId)
    {
        gAbuseId = abuseId;
        //  accept report
        $.ajax({
            type: "POST",
            url: "ajax/file_report_accept.ajax.php",
            data: { abuseId: gAbuseId },
            dataType: 'json',
            success: function(json) {
                if(json.error == true)
                {
                    $('#confirmDelete').dialog('close');
					hideModal();
                    showError(json.msg);
                }
                else
                {
                    $('#confirmDelete').dialog('close');
					hideModal();
                    showSuccess(json.msg);
                    $('#removal_type').val(3);
                    $('#admin_notes').val('');
                    reloadTable();
                    callback();
                }

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                showError(XMLHttpRequest.responseText);
            }
        });
    }
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
You would need to comment out the old code aswell. i.e.

//$('#confirmDelete').dialog('close');

It's in both sections.