Changeset 23496


Ignore:
Timestamp:
2014/06/02 18:52:25 (10 years ago)
Author:
pineray
Message:

#2028 カテゴリ登録CSVで、お互いを親カテゴリに指定できてしまう

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php

    r23439 r23496  
    495495            $item['category_name'] = '※ カテゴリの登録最大数を超えました。'; 
    496496        } 
    497         // 階層上限チェック 
     497 
    498498        if (array_search('parent_category_id', $this->arrFormKeyList) !== FALSE 
    499499                and $item['parent_category_id'] != '') { 
     500            // 階層上限チェック 
    500501            $arrParent = $objCategory->get($item['parent_category_id']); 
    501502            if ($arrParent['level'] >= LEVEL_MAX) { 
    502503                $arrErr['parent_category_id'] = '※ ' . LEVEL_MAX . '階層以上の登録はできません。'; 
    503504            } 
    504         } 
     505            // 親カテゴリー論理チェック 
     506            if (array_search('category_id', $this->arrFormKeyList) !== FALSE 
     507                and $item['category_id'] != '') { 
     508                $arrTrail = $objCategory->getTreeTrail($item['parent_category_id'], true); 
     509                foreach ($arrTrail as $trailId) { 
     510                    if ($trailId == $item['category_id']) { 
     511                        $arrErr['parent_category_id'] = '※ 再帰的な親カテゴリーの指定はできません。'; 
     512                    } 
     513                } 
     514            } 
     515        } 
     516 
    505517 
    506518        return $arrErr; 
Note: See TracChangeset for help on using the changeset viewer.