Filters are duplicated for 2 morphToMany fields with same resource class and filters on pivot columns of relations #6559
Unanswered
corporate-libraries
asked this question in
Ideas & Feature Requests
Replies: 3 comments
-
Please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example) |
Beta Was this translation helpful? Give feedback.
0 replies
-
added link to reproduction repo |
Beta Was this translation helpful? Give feedback.
0 replies
-
In theory this isn't possible with the current Vuex store structure. We will need to revamp the filters store in order to differentiate resources filter by relationship name. Moved to Ideas for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I have Book resource, in which there are 2 MorphToMany fields, each with different relation but both linked to User resource.
Each of the relations have pivot columns which are filterable (timestamp columns on pivot tables).
When page is loaded, filters from one relation are duplicated to another.
From my understanding, this happens because there are 2 endpoint calls for getting each of the fields' filters ->
and the payload from the latter one overrides filters for both relations.
I guess this happens because Nova binds filters by resource (in FilterController class - Nova::resourceForKey($this->route('resource')); - it resolves as User for both relations)
This issue reproduces specifically in cases with filters on pivot columns
Beta Was this translation helpful? Give feedback.
All reactions