mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
Fixes #13508: Fixed duplicate attachment of behavior BC break
Fixes BC break introduced in
954c771fdb (diff-d45d5e14cbb9739c2e1c63b53ba5e363L669)
This commit is contained in:
committed by
Alexander Makarov
parent
5eded299e0
commit
25b78aa615
@ -1,10 +1,10 @@
|
||||
Yii Framework 2 Change Log
|
||||
==========================
|
||||
|
||||
2.0.12 under development
|
||||
2.0.11.2 under development
|
||||
--------------------------
|
||||
|
||||
- no changes in this release.
|
||||
- Bug #13508: Fixed duplicate attachment of behavior BC break (cebe)
|
||||
|
||||
|
||||
2.0.11.1 February 02, 2017
|
||||
|
||||
@ -669,14 +669,14 @@ class Component extends Object
|
||||
if (is_int($name)) {
|
||||
$behavior->attach($this);
|
||||
$this->_behaviors[] = $behavior;
|
||||
} else {
|
||||
if (isset($this->_behaviors[$name])) {
|
||||
$this->_behaviors[$name]->detach();
|
||||
}
|
||||
$behavior->attach($this);
|
||||
$this->_behaviors[$name] = $behavior;
|
||||
}
|
||||
|
||||
if (isset($this->_behaviors[$name])) {
|
||||
$this->_behaviors[$name]->detach();
|
||||
}
|
||||
$behavior->attach($this);
|
||||
$this->_behaviors[$name] = $behavior;
|
||||
|
||||
return $behavior;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user