Skip to content
Snippets Groups Projects
Commit 27d9ae0f authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #8150 [dest_to_copy_during_redirect] dest was not put in copy if there is no copy

parent 6c757952
No related branches found
No related tags found
No related merge requests found
...@@ -429,35 +429,43 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col ...@@ -429,35 +429,43 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col
$old_dest = $stmt->fetchObject(); $old_dest = $stmt->fetchObject();
if ($old_dest && isset($new_difflist['copy']['users'])) { if ($old_dest) {
// try to find old dest in copies already // try to find old dest in copies already
$found = false; $found = false;
for ($ci=0; $ci<count($new_difflist['copy']['users']);$ci++) { if (isset($new_difflist['copy']['users'])) {
for ($ci=0; $ci<count($new_difflist['copy']['users']);$ci++) {
// If in copies before, add number of views as dest to number of views as copy // If in copies before, add number of views as dest to number of views as copy
if ($new_difflist['copy']['users'][$ci]['user_id'] == $old_dest->item_id) { if ($new_difflist['copy']['users'][$ci]['user_id'] == $old_dest->item_id) {
$found = true; $found = true;
$new_difflist['copy']['users'][$ci]['viewed'] = $new_difflist['copy']['users'][$ci]['viewed'] + (integer)$old_dest->viewed; $new_difflist['copy']['users'][$ci]['viewed'] =
break; $new_difflist['copy']['users'][$ci]['viewed'] + (integer)$old_dest->viewed;
break;
}
} }
}
//re-built session without dest in copy //re-built session without dest in copy
$tab=array(); $tab=array();
for ($ci=0; $ci<count($new_difflist['copy']['users']);$ci++) { for ($ci=0; $ci<count($new_difflist['copy']['users']);$ci++) {
if ($new_difflist['copy']['users'][$ci]['user_id'] != $new_dest) { if ($new_difflist['copy']['users'][$ci]['user_id'] != $new_dest) {
array_push( array_push(
$tab, $tab,
array( array(
'user_id' => $new_difflist['copy']['users'][$ci]['user_id'], 'user_id' => $new_difflist['copy']['users'][$ci]['user_id'],
'viewed' => (integer)$new_difflist['copy']['users'][$ci]['viewed'], 'viewed' => (integer)$new_difflist['copy']['users'][$ci]['viewed'],
'visible' => 'Y', 'visible' => 'Y',
'difflist_type' => $new_difflist['copy']['users'][$ci]['viewed'] 'difflist_type' => $new_difflist['copy']['users'][$ci]['viewed']
) )
); );
}
}
$new_difflist['copy']['users']=$tab;
} else {
if (!isset($new_difflist['copy'])) {
$new_difflist['copy'] = array();
} }
$new_difflist['copy']['users'] = array();
} }
$new_difflist['copy']['users']=$tab;
if (!$found) { if (!$found) {
array_push( array_push(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment