mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 02:22:39 +00:00
Fixing issues where ModelBehavior::detach() would not detach behaviors when a plugin.name was provided. This change makes detach() work like attach(). Tests added. Fixes #711
This commit is contained in:
parent
0648c6604b
commit
79839c07d2
2 changed files with 23 additions and 0 deletions
|
@ -372,6 +372,7 @@ class BehaviorCollection extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function detach($name) {
|
||||
list($plugin, $name) = pluginSplit($name);
|
||||
if (isset($this->{$name})) {
|
||||
$this->{$name}->cleanup(ClassRegistry::getObject($this->modelName));
|
||||
unset($this->{$name});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue