Changeset 21034


Ignore:
Timestamp:
2011/07/16 15:45:59 (13 years ago)
Author:
AMUAMU
Message:

#1321 (商品更新時に SC_Helper_DB#sfCountCategory でエラー)に関する修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/helper/SC_Helper_DB.php

    r20813 r21034  
    867867        $ret = $id; 
    868868 
    869         while($ret != "0") { 
     869        while($ret != "0" && !SC_Utils_Ex::isBlank($ret)) { 
    870870            $arrParents[] = $ret; 
    871871            $ret = SC_Helper_DB_Ex::sfGetParentsArraySub($table, $pid_name, $id_name, $ret); 
     
    879879    /* 子ID所属する親IDを取得する */ 
    880880    function sfGetParentsArraySub($table, $pid_name, $id_name, $child) { 
    881         $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     881        if(SC_Utils_Ex::isBlank($child)) { 
     882            return false; 
     883        } 
     884        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     885        if(!is_array($child)) { 
     886            $child = array($child); 
     887        } 
    882888        $parent = $objQuery->get($pid_name, $table, "$id_name = ?", $child); 
    883889        return $parent; 
Note: See TracChangeset for help on using the changeset viewer.