-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate configs on certain situations #578
Comments
Add .idea to gitignore
I had made a PR to overwrite the config instead of merging again but closed it to avoid any potential issue I might have not considered. Your issue can be fixed by using |
In future the fields config should be nested inside a |
I was dealing with an issue that duplicates items when I passed
nameCallback
as an array like this[$object, 'methodName']
, for example, with this config:nameCallback
is never called, to understand why, I read Behavior config after adding it, andnameCallback
had this valueDigging into the code I find out that
\Josegonzalez\Upload\Model\Behavior\UploadBehavior
doesn't have a constructor, so it inherits from\Cake\ORM\Behavior
, so thesetConfig
is called twice:cakephp-upload/src/Model/Behavior/UploadBehavior.php
Line 49 in 1b76964
and in both cases is called with
merge = true
which is the default, I've tried replace that last line with$this->setConfig($configs, null, 'shallow');
and it works ok, but I don't know if that's the best solution as it is callingsetConfig
twice anyway, maybe a better solution is to add a constructor and call parent constructor with an empty array as configs.The text was updated successfully, but these errors were encountered: