-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error in ConstStrategy while formatig results #55
Comments
@kaihoefler thank you for reporting this issue. I see that you are using the |
@arusinowski , It is working fine in CakePHP3 and enum package version '1.4.0'. But, I upgraded the project from CakePHP3 to CakePHP4. I am using version 2.1.0 for CakePHP4 and facing the same problem. Can you fix it for CakePHP4? |
I get the following error when I use the const strategy with enum:
Cake\Utility\Hash::get(): Argument #2 ($path) must be of type array|string|int|null, Cake\ORM\Entity given, called in /application/vendor/cakedc/enum/src/Model/Behavior/Strategy/ConstStrategy.php on line 133
The situation i experience is that while iterating through the result set of a query the $row in the beforeFind event already has been formated and is of type Cake\ORM\Entity.
I do not understand how this happens, but it can be fixed by adding the line
if ($constant instanceof Entity) return $row;
after line 128 in the class ConstStrategy.The text was updated successfully, but these errors were encountered: