From a663258f59165319a11b7548eefe406d4568ca68 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 12 Jun 2013 18:59:52 +0200 Subject: [PATCH] Should fix bug BT#6294 when uploading a file the itemproperty.insert_user_id is not correctly saved, we now take the student_publication.user_id to identify the author. --- main/work/work.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 18f7a5469b..8a11130857 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -1616,12 +1616,17 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher $is_author = false; $can_read = false; + $owner_id = $work['user_id']; - $item_property_data = api_get_item_property_info(api_get_course_int_id(), 'work', $item_id, api_get_session_id()); + /* Because a bug found when saving items using the api_item_property_update() + the field $item_property_data['insert_user_id'] is not reliable. */ - if (!$is_allowed_to_edit && $item_property_data['insert_user_id'] == api_get_user_id()) { + // $item_property_data = api_get_item_property_info(api_get_course_int_id(), 'work', $item_id, api_get_session_id()); + //if (!$is_allowed_to_edit && $item_property_data['insert_user_id'] == api_get_user_id()) { + if (!$is_allowed_to_edit && $owner_id == api_get_user_id()) { $is_author = true; } + if ($course_info['show_score'] == 0 ) { $can_read = true; }