1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

Fix Scrutinizer reported errors

This commit is contained in:
Afterster 2014-07-09 23:27:14 +02:00
parent 4a2d7b97f6
commit 80cd08ed04
29 changed files with 117 additions and 92 deletions

View file

@ -194,7 +194,7 @@ class Tag extends database_object implements library_item
if ($data['select_tags']) {
$merge_to = Tag::construct_from_name($data['select_tags']);
if ($merge_to->id) {
$tag->merge($merge_to->id, ($data['merge_persist'] == '1'));
$this->merge($merge_to->id, ($data['merge_persist'] == '1'));
}
}
@ -241,9 +241,12 @@ class Tag extends database_object implements library_item
$db_results = Dba::read($sql, array($this->id));
$results = array();
while ($row = Dba::fetch_assoc($db_results)) {
$results[$row['id']] = array('id'=>$row['id'], 'name'=>$row['name']);
}
return $results;
}
/**
@ -654,11 +657,13 @@ class Tag extends database_object implements library_item
$medias = array();
if ($filter_type) {
$ids = Tag::get_tag_objects($filter_type, $this->id);
foreach ($ids as $id) {
$medias[] = array(
'object_type' => $filter_type,
'object_id' => $id
);
if ($ids) {
foreach ($ids as $id) {
$medias[] = array(
'object_type' => $filter_type,
'object_id' => $id
);
}
}
}
return $medias;