Changeset 27414


Ignore:
Timestamp:
Feb 19, 2014, 10:23:02 AM (7 years ago)
Author:
JanisV
Message:

Fixed updating representative image for virtual albums

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/physical2virtual/main.inc.php

    r27413 r27414  
    3737{
    3838  $query = '
    39 SELECT DISTINCT virt_category_id AS id
     39SELECT DISTINCT virt_category_id AS id, representative_picture_id
    4040  FROM '.PHY2VIRT_CATEGORIES_TABLE.'
     41  JOIN '.CATEGORIES_TABLE.' ON '.PHY2VIRT_CATEGORIES_TABLE.'.virt_category_id = '.CATEGORIES_TABLE.'.id
    4142  WHERE phy_category_id = '.$phy_category['id'].'
    4243;';
     
    4445  if (!empty($virt_category))
    4546  {
    46     return $virt_category; /// add $virt_cat['representative_picture_id']
     47    return $virt_category;
    4748  }
    4849 
     
    104105      FROM '.CATEGORIES_TABLE.' cat
    105106      WHERE cat.dir IS NOT NULL
     107    )
     108  ;';
     109  pwg_query($query);
     110  $query = '
     111    DELETE FROM '.PHY2VIRT_CATEGORIES_TABLE.'
     112    WHERE virt_category_id NOT IN (
     113      SELECT cat.id
     114      FROM '.CATEGORIES_TABLE.' cat
     115      WHERE cat.dir NOT NULL
    106116    )
    107117  ;';
Note: See TracChangeset for help on using the changeset viewer.