Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Use last created record in relations, instead of first #586

Closed
rijkvanzanten opened this issue Nov 14, 2018 · 2 comments
Closed

Use last created record in relations, instead of first #586

rijkvanzanten opened this issue Nov 14, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rijkvanzanten
Copy link
Member

If there's multiple relations for the same field, the API should use the one with the highest ID (latest) to ensure the relationship is the correct one.

Ref https://github.com/directus/app/issues/1085

@rijkvanzanten rijkvanzanten added the bug Something isn't working label Nov 14, 2018
@rijkvanzanten rijkvanzanten added this to To do in v2.0.8 via automation Nov 14, 2018
@rijkvanzanten rijkvanzanten added this to To do in v2.0.9 Nov 17, 2018
@benhaynes benhaynes added this to Needs triage in Bug Triage via automation Nov 21, 2018
@wellingguzman wellingguzman added enhancement New feature or request and removed bug Something isn't working labels Nov 21, 2018
@wellingguzman wellingguzman moved this from Needs triage to Low priority in Bug Triage Nov 21, 2018
@wellingguzman wellingguzman moved this from To do to In progress in v2.0.9 Nov 21, 2018
Bug Triage automation moved this from Low priority to Closed Nov 21, 2018
v2.0.9 automation moved this from In progress to Done Nov 21, 2018
@rijkvanzanten
Copy link
Member Author

@wellingguzman This appears to be selecting the first relation it encounters, instead of the last.

When having rows like follows in directus_relations

id collection_many field_many collection_one
18 books author dvds
19 books author authors

I can confirm with these rows, the API is trying to match items from dvds instead of authors.

@rijkvanzanten rijkvanzanten reopened this Jan 11, 2019
@benhaynes benhaynes added this to To do in v2.0.14 via automation Jan 11, 2019
@benhaynes benhaynes moved this from Closed to Needs triage in Bug Triage Jan 11, 2019
@wellingguzman wellingguzman moved this from To do to In progress in v2.0.14 Jan 11, 2019
Bug Triage automation moved this from Needs triage to Closed Jan 11, 2019
v2.0.14 automation moved this from In progress to Done Jan 11, 2019
@wellingguzman
Copy link
Contributor

This has been fixed by 4cad47f.

This issue is somehow related with #598, where the relations cannot be duplicated. When that happens the fixed above should be reverted (if necessary)

samvasko pushed a commit to samvasko/api that referenced this issue Nov 25, 2019
* Rename v-activity-overview v-activity

* Rename v-edit-form v-form

* Rename interface->input

* Rename readonly->display

* Move interface ext in interfaces folder

* Rename listing to layout

* Rename v-header-bar -> v-header

* Rename v-item-listing -> v-items

* Fix renaming bug

* Rename v-permission-widget -> v-permissions

* Rename item-listing-> items & edit->item

* Fix broken import
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Bug Triage
  
Closed
v2.0.14
  
Done
v2.0.8
  
To do
v2.0.9
  
Done
Development

No branches or pull requests

2 participants