Skip to content

Commit

Permalink
Make sure sub_folder_shared has correct role and empty workspaces are…
Browse files Browse the repository at this point in the history
… retrieved correctly
  • Loading branch information
torinfo committed Mar 1, 2023
1 parent 34f3a12 commit cb50892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website_code/php/display_library.php
Expand Up @@ -651,6 +651,7 @@ function get_workspace_contents($folder_id, $tree_id, $sort_type, $copy_only=fal
if(!$found){
if($folder['nrshared'] > 1 && $files[$index]->type == "folder"){
$files[$index]->type = "sub_folder_shared";
$files[$index]->role = $folder['role'];
}
array_push($items, $file);
}
Expand Down Expand Up @@ -1072,7 +1073,7 @@ function insert_groupitems_into_workspace_items($workspace_items, $group_items){
// Create a new array and start copying $workspace_itmes until we find the first item with xot_type file and parent = $root_id
$new_workspace_items = array();
$i = 0;
while ($workspace_items[$i]->xot_type != 'file' || $workspace_items[$i]->parent != $root_id) {
while ($i < count($workspace_items) && ($workspace_items[$i]->xot_type != 'file' || $workspace_items[$i]->parent != $root_id)) {
$new_workspace_items[] = $workspace_items[$i];
$i++;
}
Expand Down

0 comments on commit cb50892

Please sign in to comment.