Skip to content

Commit 14a03d8

Browse files
author
Alex Killing
committed
added some loggin to page and media objects
1 parent 98d0c29 commit 14a03d8

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

Services/COPage/classes/class.ilPageObject.php

+19-2
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,14 @@ function update($a_validate = true, $a_no_history = false)
26172617
function delete()
26182618
{
26192619
global $ilDB;
2620-
2620+
2621+
$copg_logger = ilLoggerFactory::getLogger('copg');
2622+
$copg_logger->debug("ilPageObject: Delete called for ID '".$this->getId()."',".
2623+
" parent type: '".$this->getParentType()."', ".
2624+
" hist nr: '".$this->old_nr."', ".
2625+
" lang: '".$this->getLanguage()."', "
2626+
);
2627+
26212628
$mobs = array();
26222629
$files = array();
26232630

@@ -2627,6 +2634,8 @@ function delete()
26272634
$mobs = $this->collectMediaObjects(false);
26282635
}
26292636

2637+
$copg_logger->debug("ilPageObject: ... found ".count($mobs)." media objects.");
2638+
26302639
$this->__beforeDelete();
26312640

26322641
// delete style usages
@@ -2653,17 +2662,25 @@ function delete()
26532662
// delete media objects
26542663
foreach ($mobs as $mob_id)
26552664
{
2665+
$copg_logger->debug("ilPageObject: ... processing mob ".$mob_id.".");
2666+
26562667
if(ilObject::_lookupType($mob_id) != 'mob')
26572668
{
2658-
$GLOBALS['ilLog']->write(__METHOD__.': Type mismatch. Ignoring mob with id: '.$mob_id);
2669+
$copg_logger->debug("ilPageObject: ... type mismatch. Ignoring mob ".$mob_id.".");
26592670
continue;
26602671
}
26612672

26622673
if (ilObject::_exists($mob_id))
26632674
{
2675+
$copg_logger->debug("ilPageObject: ... delete mob ".$mob_id.".");
2676+
26642677
$mob_obj =& new ilObjMediaObject($mob_id);
26652678
$mob_obj->delete();
26662679
}
2680+
else
2681+
{
2682+
$copg_logger->debug("ilPageObject: ... missing mob ".$mob_id.".");
2683+
}
26672684
}
26682685

26692686

Services/COPage/service.xml

+1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333
<pagecontent pc_type="src" name="SourceCode" directory="classes" int_links="0" style_classes="0" xsl="0" def_enabled="1"/>
3434
<pagecontent pc_type="templ" name="ContentTemplate" directory="classes" int_links="0" style_classes="0" xsl="0" def_enabled="0"/>
3535
</copage>
36+
<logging />
3637
</service>

Services/MediaObjects/classes/class.ilObjMediaObject.php

+18
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,18 @@ public static function _exists($a_id)
9999
*/
100100
function delete()
101101
{
102+
$mob_logger = ilLoggerFactory::getLogger('mob');
103+
$mob_logger->debug("ilObjMediaObject: Delete called for media object ID '".$this->getId()."'.");
104+
102105
if (!($this->getId() > 0))
103106
{
104107
return;
105108
}
106109

107110
$usages = $this->getUsages();
108111

112+
$mob_logger->debug("ilObjMediaObject: ... Found ".count($usages)." usages.");
113+
109114
if (count($usages) == 0)
110115
{
111116
// remove directory
@@ -126,6 +131,19 @@ function delete()
126131

127132
// delete object
128133
parent::delete();
134+
135+
$mob_logger->debug("ilObjMediaObject: ... deleted.");
136+
}
137+
else
138+
{
139+
foreach ($usages as $u)
140+
{
141+
$mob_logger->debug("ilObjMediaObject: ... usage type:".$u["type"].
142+
", id:".$u["id"].
143+
", lang:".$u["lang"].
144+
", hist_nr:".$u["hist_nr"].".");
145+
}
146+
$mob_logger->debug("ilObjMediaObject: ... not deleted.");
129147
}
130148
}
131149

Services/MediaObjects/service.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
<secure_path path="mobs" checking-class="ilObjMediaObjectAccess" />
1414
<secure_path path="thumbs" checking-class="ilObjMediaObjectAccess" />
1515
</web_access_checker>
16+
<logging />
1617
</service>

setup/sql/dbupdate_04.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -12250,10 +12250,13 @@ public function raise($a_component, $a_event, $a_parameter = "") {
1225012250
$ilCtrlStructureReader->getStructure();
1225112251
?>
1225212252
<#4775>
12253-
<?php
1225412253
$ilDB->modifyTableColumn(
1225512254
'il_dcl_field',
1225612255
'description',
1225712256
array("type" => "clob")
1225812257
);
1225912258
?>
12259+
<#4776>
12260+
$ilCtrlStructureReader->getStructure();
12261+
?>
12262+

0 commit comments

Comments
 (0)