Comments (8)
Thanks for checking it out @lukas-frey
What's the use case actually here? Why do you need to disable scoping on the PageResource? It belongs to a document, which is scoped to a tenant anyways, so it will still be scoped to a tenant via this relationship. Is it really necessary to have it disabled? Maybe I'm missing something.
Not entirely needed no - I'm was just trying to keep the database smaller and because a document already belonged to a tenant, it seemed a wasted field to also include it on the pages. They can only be browsed via the DocumentResource
so didn't need to be scoped.
Anyways, your best bet for now is to override the handleRecordCreation method in your CreateDocumentPage class and replace the static::getResource() call with the actual resource (PageResource) in your case.
Thanks, I'll give this a shot when I'm looking at it again.
from filament-nested-resources.
@jamessessford Hi, thanks for the bug report. Can you provide a test repository with the bug? I tried reproducing it as you described and I can disable tenant scoping without an issue.
from filament-nested-resources.
I will bud! Is there any chance you can put the test repo you've made up to see if I've just made a mistake?
from filament-nested-resources.
Sorry it took a little longer than I expected @lukas-frey - the test repo is available at https://github.com/jamessessford/nested-resource-bug
from filament-nested-resources.
Sorry it took a little longer than I expected @lukas-frey - the test repo is available at https://github.com/jamessessford/nested-resource-bug
Thanks for the repo. The issue is that you're trying to set one of the child nested resources (not the root nested resource) as not scoped. However, since the CreateDocumentPage
is a DocumentResource
page, not a PageResource
page, it uses the isScopedToTenant
setting from DocumentResource, not PageResource (CreateRelatedRecord class line 184).
Currently there's no easy way for me to know the related resource without introducing another property you need to manually set in each page, which is not something I'm too inclined to do right now.
What's the use case actually here? Why do you need to disable scoping on the PageResource? It belongs to a document, which is scoped to a tenant anyways, so it will still be scoped to a tenant via this relationship. Is it really necessary to have it disabled? Maybe I'm missing something.
Anyways, your best bet for now is to override the handleRecordCreation
method in your CreateDocumentPage
class and replace the static::getResource()
call with the actual resource (PageResource) in your case.
from filament-nested-resources.
@lukas-frey - I think I've fixed this in my local version - are you happy if I raise a pull request for you to have a look at?
from filament-nested-resources.
@lukas-frey - I think I've fixed this in my local version - are you happy if I raise a pull request for you to have a look at?
Sure, you're more than welcome to create a PR and I'll have a look! :)
from filament-nested-resources.
Thanks, @lukas-frey
from filament-nested-resources.
Related Issues (20)
- [Bug]: Incorrect urls generated when primaryKey is not "id" HOT 5
- [Bug]: getTableQuery in list view of child resources are not filtered. HOT 5
- [Bug]: Looks like no support for manyToMany HOT 2
- [Bug]: ForceDeleteAction generates error on NestedEditRecord class HOT 1
- [Bug]: When view is enabled the breadcrumbs link is still to edit page... HOT 2
- [Bug]: can't get parent model id HOT 5
- [Bug]: Cannot install via composer HOT 1
- [Bug]: ManageRelatedRecords pages have blank ancestor route paramaters HOT 2
- [Bug]: Can't install the package HOT 1
- [Bug]: Cant install using composer require guava/filament-nested-resources HOT 1
- [Bug]: getBreadcrumbs gives error when a field is refreshing HOT 4
- [Bug]: CreateRelatedRecord and Translatable HOT 1
- [Bug]: 404 on all nested relation pages HOT 4
- [Bug]: Access to undeclared static property App\Filament\Resources\CourseResource\Pages\CreateCourseLesson::$relationship HOT 5
- [Bug]: Unable to get nested Create to work in new release HOT 5
- [Bug]: Ancestor duplicate query
- [Bug]: Unabled to get nested relation appear in the create/edit form HOT 1
- [Bug]: N+1 Queries HOT 1
- [Bug]: Route [filament.admin.resources.albums.index] not defined. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament-nested-resources.