39 return 'Orphaned Assets Test';
52 return 'A test to check for orphaned assets in Matrix';
66 public static function test(&$messages, &$errors)
69 $sql =
'SELECT assetid FROM sq_ast WHERE assetid NOT IN (SELECT minorid AS assetid FROM sq_ast_lnk WHERE link_type < 8)';
71 if (!empty($results)) {
73 foreach ($results as $index => $result) {
74 $results[$index] = $result[
'assetid'];
76 $results = array_unique($results);
79 $messages[] =
'There are '.count($results).
' orphaned asset(s) on the system';
80 foreach ($results as $asset) {
81 $errors[] =
'Asset #'.$asset.
' is orphaned on the system';