Ignore:
Timestamp:
Jan 23, 2010, 11:56:11 PM (14 years ago)
Author:
plg
Message:

bug 1396: when a photo was deleted, the code to avoid orphans as category
representative was 1) wrong (because a photo doesn't have to belong to a
category to represent it) 2) at the wrong place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/include/functions.php

    r4617 r4730  
    235235  pwg_query($query);
    236236
     237  // are the photo used as category representant?
     238  $query = '
     239SELECT
     240    id
     241  FROM '.CATEGORIES_TABLE.'
     242  WHERE representative_picture_id IN (
     243'.wordwrap(implode(', ', $ids), 80, "\n").')
     244;';
     245  $category_ids = array_from_query($query, 'id');
     246  if (count($category_ids) > 0)
     247  {
     248    update_category($category_ids);
     249  }
     250 
    237251  trigger_action('delete_elements', $ids);
    238252}
Note: See TracChangeset for help on using the changeset viewer.