Open tipue-dev opened 6 months ago
@tipue-dev I can't reproduce this with version Znuny LTS 6.5.9. Any ideas or is it just magically working again?
@rkaldung i just tested it again in a fresh installation of 6.5.9.
Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends
Ticket::Article::Backend::MIMEBase::ArticleStorage
to FSotrs.Console.pl Admin::Article::StorageSwitch --target ArticleStorageFS
The missing change of the ArticleStorage to FS might have been the problem in reproducing it.
https://github.com/znuny/Znuny/assets/80031303/88731a25-e64b-415c-9c7e-69bb4c842f51
Proposed change
Problem: Using Admin::Article::StorageSwitch when
Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends
is active changes all html articles to plaintext.When switching between the backends FS and DB (Admin::Article::StorageSwitch), the code looks up, if a file with the same name exists already (because of some Unicode situation described here). To check this, the code gets all attachments of the article from the target backend.
The problem is, that the function used to list all attachments can look up the files in the other backend if the config
Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends
is active. In that case, when no attachment has been written to the new backend yet, the file list of the old backend is returned instead. That means the first attachment, is wrongly assumed to already exists and gets renamed with a suffixing-1
.Since the first attachment is always
file-1
(plain text) orfile-2
(html), those will be renamed tofile-x-1
on every switch and not recognised as special attachments anymore. This means the article suddenly is plain text with an attachment namedfile-x-1
added in the TicketZoom. Every switch adds more-1
at the end, that means if someone tries to fix this by switching between the backends, the filename becomes longerfile-2-1-1-1-1-1
.The parameter needed to fix this already exists for different cases an can be used here too.
To reproduce the behaviour:
Ticket::Article::Backend::MIMEBase::CheckAllStorageBackends
1 - π bug π
Checklist