Changeset 6048


Ignore:
Timestamp:
05/03/10 00:06:39 (9 years ago)
Author:
plg
Message:

bug 1638 fixed: the "admin>tools>maintenance>unlinked elements" features now
works if you have only virtual categories, this is what happens if you don't
use synchronization to add photos (if you use pLoader or UploadForm for
example).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set.php

    r5196 r6048  
    141141  $query = ' 
    142142SELECT id 
     143  FROM '.IMAGES_TABLE.' 
     144;'; 
     145  $all_elements = array_from_query($query, 'id'); 
     146 
     147  $linked_to_virtual = array(); 
     148 
     149  $query = ' 
     150SELECT id 
    143151  FROM '.CATEGORIES_TABLE.' 
    144152  WHERE dir IS NULL 
    145153;'; 
    146154  $virtual_categories = array_from_query($query, 'id'); 
    147  
    148155  if (!empty($virtual_categories)) 
    149156  { 
    150     $query = ' 
    151 SELECT DISTINCT(image_id) 
    152   FROM '.IMAGE_CATEGORY_TABLE.' 
    153 ;'; 
    154     $all_elements = array_from_query($query, 'image_id'); 
    155  
    156157    $query = ' 
    157158SELECT DISTINCT(image_id) 
     
    160161;'; 
    161162    $linked_to_virtual = array_from_query($query, 'image_id'); 
    162  
    163     $page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual); 
    164   } 
     163  } 
     164 
     165  $page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual); 
    165166} 
    166167else if ('duplicates' == $_GET['cat']) 
Note: See TracChangeset for help on using the changeset viewer.