mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-03 10:02:42 +00:00
Fixing merging of actsAs and _findMethods from PluginAppModel classes. Adding test cases and necessary test classes
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7875 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b43128c809
commit
6806b895cb
3 changed files with 99 additions and 5 deletions
|
@ -379,6 +379,15 @@ class Model extends Overloadable {
|
|||
if ($this->actsAs !== null || $this->actsAs !== false) {
|
||||
$merge[] = 'actsAs';
|
||||
}
|
||||
$parentClass = get_parent_class($this);
|
||||
if (strtolower($parentClass) !== 'appmodel') {
|
||||
$parentVars = get_class_vars($parentClass);
|
||||
foreach ($merge as $var) {
|
||||
if (isset($parentVars[$var]) && !empty($parentVars[$var])) {
|
||||
$appVars[$var] = Set::merge($appVars[$var], $parentVars[$var]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($merge as $var) {
|
||||
if (isset($appVars[$var]) && !empty($appVars[$var]) && is_array($this->{$var})) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue