-
Notifications
You must be signed in to change notification settings - Fork 224
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
Since 0.12.4 I get error "GeneaLabs\LaravelModelCaching\CacheKey::processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|string, null given, called in ...\vendor\genealabs\laravel-model-caching\src\CacheKey.php on line 409" #443
Comments
Hi @Restingo, could you provide a repository with sample code that reproduces this issue? |
I have the same problem, this happens when you have a hasMany() relationship and the local key is null |
This is also happening to me. I've been stuck on 0.12.3 |
same problem in the latest version which is 0.13 @mikebronner is there any plan to fix this, or maybe a workaround? i also tries to install a lower version (0.12.2) but it has problem with latest version of laravel. |
I'm having the same issue after upgrading to Laravel 10. |
Looks like #432 is related. |
@Ham3D @wolfpack4417 are you able to reproduce and paste the code or snippet here? I fixed it somehow in my env but don't know how. If you can give me the reproducible code I'll create a fix. Thank you. |
@Restingo It's been a while since we had this issue and what I can remember if you have a setup like the snippet below and
(I wrote this from head so you might need to tweek it) |
@Restingo I'm getting this error when trying to delete an entity that also has soft cascading deletes via this package : askedio/laravel-soft-cascade This is the code: `class FuelCard extends BaseModel
} And it fails here:
Let me know if you need any more information from me, and thanks for helping with this! |
@wolfpack4417 would it be possible to push a small repo with the needed code in it to reproduce? Thx. |
or submit a PR with a failing test, either would be great |
@mikebronner I am facing this issue now with a nullable one-to-many relationship I was able to get around this issue by adding a null cast type and null return type to vendor/genealabs/laravel-model-caching/src/CacheKey.php processEnum() method. Could someone be able to have a look and make sure this doesn't cause any negative effects. I tried creating a PR but i'm a PR Rookie and couldn't figure out how to push it... i kept getting permission errors.
|
@peter-brennan thanks for submitting additional details. I will take a look at this. |
I figured out how to create a PR hahaha, I made that change for you. #456 |
Nice, that helps a lot, thanks @peter-brennan ! |
Any news? I am facing the same issue and have been waiting for a fix. |
How is the progress? I'm facing the same issue and have been waiting for a fix. |
Reviewing the PR now ... hopefully I can get it merged this morning. |
This should be fixed now. Thanks for your patience. |
Thank you very much and wish you a Merry Christmas in advance. |
@mikebronner My PHP version is 8.0 and I can only use version 0.12.5. I want to fix this problem in version 0.12.5, Can you create a branch based on tag 0.12.5? So can I create a pull request to merge into this branch and then have you create a 0.12.6 tag? |
Hi @emptyrealm, I would recommend you create a fork for your use, downgrade PHP in your fork, then return to using the package once you are back on a supported PHP version. At this time I won't be adding back-support to older versions of PHP or Laravel. However, once this package gets to version 1.0 (hopefully by or before Laravel 12), we will be maintaining LTS version support for Laravel, and Active/Security supported versions of PHP. |
@mikebronner OK, I'll try it, thank you for your patience reply. This Package is really useful, thank you. |
I still have the same issue guy's, any updates ? |
@ahmadaldabouqii please open a new issue with all your details and stack trace info. |
Describe the bug
Since the version
0.12.4
I get errorGeneaLabs\LaravelModelCaching\CacheKey::processEnum(): Argument #1 ($value) must be of type BackedEnum|UnitEnum|string, null given, called in ...\vendor\genealabs\laravel-model-caching\src\CacheKey.php on line 409
when querying a relationship on a new model that is currently empty.Eloquent Query
Stack Trace
Environment
Additional context
Tried downgrading to
0.12.3
to test and with this version it works.The text was updated successfully, but these errors were encountered: