-
Notifications
You must be signed in to change notification settings - Fork 56
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
Undefined array key 1 related to PageRoutesService #198
Comments
Could you please provide the following details so I can debug this more easily without resorting to a hacky fix?
// Each ">" indicates a new line prompt
/*>*/ Cache::get('filament-fabricator::PageRoutesService::id-to-uri')
/*>*/ Page::pluck('id')->toArray() |
this is config/filament-fabricator.php
|
Psy Shell v0.12.7 (PHP 8.2.12 — cli) by Justin Hileman
> Cache::get('filament-fabricator::PageRoutesService::id-to-uri')
= []
> Page::pluck('id')->toArray()
[!] Aliasing 'Page' to 'App\Livewire\Pages\Page' for this Tinker session.
BadMethodCallException Method App\Livewire\Pages\Page::pluck does not exist.
> Page::pluck('id')->toArray()
BadMethodCallException Method App\Livewire\Pages\Page::pluck does not exist.
>``` |
u can send me a message |
My apologies, you might need to use the Fully Qualified Name of your Page model class instead of just i.e. \Z3d0X\FilamentFabricator\Models\Page::pluck('id')->toArray() |
|
So what is the solution? |
That is very odd, according to the data you provided there's nothing that would cause a read for index By
Did you mean to say that you got that data before deleting the cache table, or that you deleted the cache table before getting that data? |
I deleted the data from the table and then did that query. So there is a problem. |
Undoubtedly. Given that the index comes from Can you provide a minimal reproducible repo with the issue? Or even just a set of steps to get to trigger the issue. So far I haven't managed to manifest it in my experimenting. |
I can add you to the repo. But I would need your email? |
If it's on github I'm pretty sure you can add by username. That being said, a repo that isn't minimal will always be tricky to find the actual underlying cause instead of a side effect of using another package in conjunction |
@rezadindar Do you have more info on the issue/repro? |
|
With the repository you've provided me, I ran some tests. Here is the protocol I followed.
Following this protocol I did not encounter the error. This is getting a bit confusing ^^ |
I think I see what might be going on for your repository. In your // Below is your own custom Page "wrapper" class
Route::get('/{page:slug}', Page::class)->name('page.show'); But in the config for filament-fabricator you still have it unprefixed: return [
'routing' => [
'enabled' => true,
'prefix' => null, // <--- Here
],
]; As such, there might be a conflict in which routing is used and you're likely to be bypassing the package's routing system. |
OK, so I seem to have found a way to reproduce it on a personal repo. I have a theory and I'm looking into it. I'll keep you guys up to date! |
It seems that somewhere in It's set to an empty array instead of being I'm going up the trail to find out what messes up the cache |
Let me know if you need any more information. Very weird what is happening. |
Found the bug! The fact that it was an array access should have been a clue, but the way it's triggered doesn't help in making it obvious. I've made the hotfix PR that will fix that issue! |
How do I solve this? Or I have to wait for a package update? |
You just have to wait for the next release :p |
When is the next release? But the problem lays whitin fabricator package? |
It should be soon enough, and yes |
I hope it gets released soon because I have to finish my project. |
Fix for this released in version |
i am getting this
and this error still is there after composer update
|
For Your issue with |
i am getting this error when trying to clear config, route etc. i don't know how to solve it. Anyone got any ideas?
The text was updated successfully, but these errors were encountered: