uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
8.73k stars 463 forks source link

After 20 cancellations, the ticket attachment cannot be selected #651

Closed yjqphp closed 1 year ago

yjqphp commented 1 year ago

Bug report

Title

After 20 cancellations, the ticket attachment cannot be selected.

Issue Description

*After 20 cancellations, the ticket attachment cannot be selected

Steps to reproduce

It is important to provide a set of clear steps to reproduce this bug.If relevant please include code samples.

1. upload
2. cancel
3. upload

Repeat 20 times。。。

Expected result

You can continue uploading.

Actual result

You can send up to 20MB in attachments. If you have more than one attachment, they can\'t add up to more than 20 MB and 20 attachments in total.

Repair

uvdesk/core-framework/Resources/views/Templates/attachment.html.twig

image

       createFileType: function(e) {
              this.removeError(e)
              var currentElement = Backbone.$(e.currentTarget),
                  attachmentBlock = currentElement.parents('.attachment-block'),
                  fileElement = Backbone.$('.attachment')
              if (attachmentBlock.children('.uv-added-attachment').length + 1 > this.max_file_uploads) {
                  attachmentBlock.append(this.getDefaultErrorMessage())
                  return;
              }
              if (!fileElement.length || fileElement[0].files.length===this.fileCounter){
                  this.fileCounter += 1;
                  attachmentBlock.append('<div class="uv-added-attachment" style="display: none" id="file-' + this.fileCounter + '"><div class="uv-attachment"><input type="file" name="attachments[]" class="attachment" multiple="multiple"></div><span></span></div>')
              }
              $('#file-' + this.fileCounter).find('.attachment').trigger('click')
          },
komal-sh-27 commented 1 year ago

Thanks for reporting here, we will check and review it. If this issue is exist and with your code is works fine without any error then we will add this code in our uvdesk.

komal-sh-27 commented 1 year ago

We have checked and unfortunately, we are not able to reproduce this issue. Also, we have tried with more than 20+ times upload and cancel files. If you are still facing the same issue then can you please share a video clip with us.

Also, let us know which verison of uvdesk you are using.

komal-sh-27 commented 1 year ago

Now, we are closing this issue. If you have still facing the same issue, you can reply to us on the same issue thread.