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

merge r4730 from branch 2.0 to trunk

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
  • trunk/admin/include/functions.php

    r4618 r4731  
    263263  pwg_query($query);
    264264
     265  // are the photo used as category representant?
     266  $query = '
     267SELECT
     268    id
     269  FROM '.CATEGORIES_TABLE.'
     270  WHERE representative_picture_id IN (
     271'.wordwrap(implode(', ', $ids), 80, "\n").')
     272;';
     273  $category_ids = array_from_query($query, 'id');
     274  if (count($category_ids) > 0)
     275  {
     276    update_category($category_ids);
     277  }
     278 
    265279  trigger_action('delete_elements', $ids);
    266280}
Note: See TracChangeset for help on using the changeset viewer.