Sto lavorando con Magento 1.8. 0.0, ho una versione di prova installato su un server WAMP tramite localhost e quando voglio aggiungere categoria di ottengo l'errore successivo:Errore irreversibile: chiamata a una funzione membro getId() su un oggetto non in C: wamp www magentno lib Varien Data Tree Dbp.php sulla riga 332
Fatal error: Call to a member function getId() on a non-object in C:\wamp\www\magentno\lib\Varien\Data\Tree\Dbp.php on line 332
non ho ancora fatto un negozio perché ho bisogno di categoria di per quella .
Ho già aggiunto un tentativo e catturare il codice per la riga che dà l'errore.
questo è il codice che dà l'errore:
public function loadEnsuredNodes($category, $rootNode)
{
$pathIds = $category->getPathIds();
$rootNodeId = $rootNode->getId();
$rootNodePath = $rootNode->getData($this->_pathField);
$select = clone $this->_select;
$select->order($this->_table.'.'.$this->_orderField . ' ASC');
if ($pathIds) {
$condition = $this->_conn->quoteInto("$this->_table.$this->_idField in (?)", $pathIds);
$select->where($condition);
}
$arrNodes = $this->_conn->fetchAll($select);
if ($arrNodes) {
$childrenItems = array();
foreach ($arrNodes as $nodeInfo) {
$nodeId = $nodeInfo[$this->_idField];
if ($nodeId<=$rootNodeId) {
continue;
}
$pathToParent = explode('/', $nodeInfo[$this->_pathField]);
array_pop($pathToParent);
$pathToParent = implode('/', $pathToParent);
$childrenItems[$pathToParent][] = $nodeInfo;
}
$this->_addChildNodes($childrenItems, $rootNodePath, $rootNode, true);
}
}
questa linea è il killer:
$rootNodeId = $rootNode->getId();
La categoria è 'null' in modo da utilizzare' -> 'sulla non-oggetto (NULL) un tiro un errore fatale. Dovresti aggiungere del codice se vuoi che ti aiutiamo per il debug. – Debflav
aggiungo ora il codice – Djeroen
Che cos'è '$ root Node'? '$ root Node' è NULL. – Debflav