Changeset 2193


Ignore:
Timestamp:
Jan 23, 2008, 10:10:13 PM (16 years ago)
Author:
vdigital
Message:

Bug with no ref (and maybe 663): Currently if the "Search in subcategories" checkbox was unselected, all existing categories and elements were duplicated.
Cause: Wrong comparison between fileserver directory list and already known files in tables.

Resolution: keeping only the selected directory from the file server directory list in such cases,
if that one is still allocated.

Location:
branches/branch-1_7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/admin/site_update.php

    r2113 r2193  
    241241  }
    242242
    243   $inserts = array();
     243  // If $_POST['subcats-included'] != 1 ("Search in subcategories" is unchecked)
     244  // $db_fulldirs doesn't include any subdirectories and $fs_fulldirs does
     245  // So $fs_fulldirs will be limited to the selected basedir
     246  // (if that one is in $fs_fulldirs)
     247  if (!isset($_POST['subcats-included']) or $_POST['subcats-included'] != 1)
     248  {
     249    $fs_fulldirs = array_intersect($fs_fulldirs, array_keys($db_fulldirs));
     250  }
     251  // print_r( $fs_fulldirs ); echo "<br>";
     252  // print_r( $db_fulldirs ); echo "<br>";
     253  // print_r( array_diff($fs_fulldirs, array_keys($db_fulldirs)) ); echo "<br>";
     254  // die('That\'s why dirs or files synchronizations were duplicating cats.');
     255
     256  $inserts = array(); 
    244257  // new categories are the directories not present yet in the database
    245258  foreach (array_diff($fs_fulldirs, array_keys($db_fulldirs)) as $fulldir)
  • branches/branch-1_7/template/yoga/admin/site_update.tpl

    r2190 r2193  
    9898
    9999    <li><label>
    100     <img class="button" src="{themeconf:icon_dir}/check.png" alt="checked checkbox">
    101     <input type="HIDDEN" name="subcats-included" value="1" {SUBCATS_INCLUDED_CHECKED} />
     100    <input type="checkbox" name="subcats-included" value="1" {SUBCATS_INCLUDED_CHECKED} />
    102101{lang:search_subcats_included}</label>
    103  / (<strong>Warning</strong>: Locked control, contact our forum if needed).</li>
     102    </li>
    104103    </ul>
    105104  </fieldset>
Note: See TracChangeset for help on using the changeset viewer.