Fix bug where handling multiple messages from multi-folder search result could not work (#6845)

pull/6852/head
Aleksander Machniak 5 years ago
parent d39d49b7a6
commit d9e3218025

@ -69,6 +69,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where Next/Prev button in mail view didn't work with multi-folder search result (#6793)
- Fix bug where selection of columns on messages list wasn't working
- Fix bug in converting multi-page Tiff images to Jpeg (#6824)
- Fix bug where handling multiple messages from multi-folder search result could not work (#6845)
RELEASE 1.4-rc1
---------------

@ -26,10 +26,10 @@ rcube_webmail.prototype.markasjunk_mark = function(is_spam) {
}
rcube_webmail.prototype.rcmail_markasjunk_move = function(mbox, uids) {
var prev_uid = this.env.uid, a_uids = $.isArray(uids) ? uids : uids.split(",");
var prev_uid = this.env.uid;
if (this.message_list && a_uids.length == 1 && !this.message_list.in_selection([a_uids[0]]))
this.env.uid = a_uids[0];
if (this.message_list && uids.length == 1 && !this.message_list.in_selection(uids[0]))
this.env.uid = uids[0];
if (mbox)
this.move_messages(mbox);

@ -3391,7 +3391,7 @@ function rcube_webmail()
this.toggle_read_status = function(flag, a_uids)
{
var i, len = a_uids.length,
post_data = this.selection_post_data({_uid: this.uids_to_list(a_uids), _flag: flag}),
post_data = this.selection_post_data({_uid: a_uids, _flag: flag}),
lock = this.display_message('markingmessage', 'loading');
// mark all message rows as read/unread
@ -3406,7 +3406,7 @@ function rcube_webmail()
{
var i, len = a_uids.length,
win = this.env.contentframe ? this.get_frame_window(this.env.contentframe) : window,
post_data = this.selection_post_data({_uid: this.uids_to_list(a_uids), _flag: flag}),
post_data = this.selection_post_data({_uid: a_uids, _flag: flag}),
lock = this.display_message('markingmessage', 'loading');
// mark all message rows as flagged/unflagged
@ -3454,7 +3454,7 @@ function rcube_webmail()
this.flag_as_undeleted = function(a_uids)
{
var i, len = a_uids.length,
post_data = this.selection_post_data({_uid: this.uids_to_list(a_uids), _flag: 'undelete'}),
post_data = this.selection_post_data({_uid: a_uids, _flag: 'undelete'}),
lock = this.display_message('markingmessage', 'loading');
for (i=0; i<len; i++)
@ -3466,7 +3466,7 @@ function rcube_webmail()
this.flag_as_deleted = function(a_uids)
{
var r_uids = [],
post_data = this.selection_post_data({_uid: this.uids_to_list(a_uids), _flag: 'delete'}),
post_data = this.selection_post_data({_uid: a_uids, _flag: 'delete'}),
lock = this.display_message('markingmessage', 'loading'),
list = this.message_list,
rows = list ? list.rows : {},
@ -3530,7 +3530,14 @@ function rcube_webmail()
// with select_all mode checking
this.uids_to_list = function(uids)
{
return this.select_all_mode ? '*' : ($.isArray(uids) ? uids.join(',') : uids);
if (this.select_all_mode)
return '*';
// multi-folder list of uids cannot be passed as a string (#6845)
if ($.isArray(uids) && (uids.length == 1 || String(uids[0]).indexOf('-') == -1))
uids = uids.join(',');
return uids;
};
// Sets title of the delete button

@ -36,18 +36,18 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
// remove mbox part from _uid
if (($_uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC)) && !is_array($_uid) && preg_match('/^\d+-.+/', $_uid)) {
list($_uid, $mbox) = explode('-', $_uid, 2);
if (isset($_GET['_uid'])) $_GET['_uid'] = $_uid;
if (isset($_POST['_uid'])) $_POST['_uid'] = $_uid;
$_REQUEST['_uid'] = $_uid;
unset($_uid);
// override mbox
if (!empty($mbox)) {
$_GET['_mbox'] = $mbox;
$_POST['_mbox'] = $mbox;
$RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox));
}
list($_uid, $mbox) = explode('-', $_uid, 2);
if (isset($_GET['_uid'])) $_GET['_uid'] = $_uid;
if (isset($_POST['_uid'])) $_POST['_uid'] = $_uid;
$_REQUEST['_uid'] = $_uid;
unset($_uid);
// override mbox
if (!empty($mbox)) {
$_GET['_mbox'] = $mbox;
$_POST['_mbox'] = $mbox;
$RCMAIL->storage->set_folder($_SESSION['mbox'] = $mbox);
}
}
if (!empty($_SESSION['browser_caps']) && !$OUTPUT->ajax_call) {

Loading…
Cancel
Save