mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
1612bdf250
commit
d70730d722
1 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_deletedRow = null;
|
||||
protected $_deletedRow = array();
|
||||
|
||||
/**
|
||||
* Initiate Tree behavior
|
||||
|
@ -129,7 +129,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
'fields' => array($Model->escapeField($left), $Model->escapeField($right)),
|
||||
'recursive' => -1));
|
||||
if ($data) {
|
||||
$this->_deletedRow = current($data);
|
||||
$this->_deletedRow[$Model->alias] = current($data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -144,8 +144,8 @@ class TreeBehavior extends ModelBehavior {
|
|||
*/
|
||||
public function afterDelete(Model $Model) {
|
||||
extract($this->settings[$Model->alias]);
|
||||
$data = $this->_deletedRow;
|
||||
$this->_deletedRow = null;
|
||||
$data = $this->_deletedRow[$Model->alias];
|
||||
$this->_deletedRow[$Model->alias] = null;
|
||||
|
||||
if (!$data[$right] || !$data[$left]) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue