[svn r18578] Avoiding wrong behavior when deleting documents see FS#2970

skala
Julio Montoya 16 years ago
parent e2a4c87760
commit b114c561eb
  1. 8
      main/inc/lib/document.lib.php

@ -813,12 +813,16 @@ class DocumentManager
while ($row = Database::fetch_array($what_to_delete_result))
{
//query to delete from item_property table
$remove_from_item_property_sql = "DELETE FROM ".$TABLE_ITEMPROPERTY." WHERE ref = ".$row['id']." AND tool='".TOOL_DOCUMENT."'";
//avoid wrong behavior
//$remove_from_item_property_sql = "DELETE FROM ".$TABLE_ITEMPROPERTY." WHERE ref = ".$row['id']." AND tool='".TOOL_DOCUMENT."'";
api_item_property_update($_course, TOOL_DOCUMENT, $row['id'], 'delete', api_get_user_id());
//query to delete from document table
$remove_from_document_sql = "DELETE FROM ".$TABLE_DOCUMENT." WHERE id = ".$row['id']."";
//echo($remove_from_item_property_sql.'<br>');
api_sql_query($remove_from_item_property_sql, __FILE__, __LINE__);
//api_sql_query($remove_from_item_property_sql, __FILE__, __LINE__);
//echo($remove_from_document_sql.'<br>');
api_sql_query($remove_from_document_sql, __FILE__, __LINE__);

Loading…
Cancel
Save