Skip to content
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

M2M relationship field bugged (blank) when adding existing item, but fixed on save. #10916

Closed
3 tasks done
StephenGunn opened this issue Jan 7, 2022 · 13 comments · Fixed by #12082
Closed
3 tasks done

Comments

@StephenGunn
Copy link
Sponsor

Preflight Checklist

Describe the Bug

This bug happened after upgrading from 9.3 -> 9.4.x, it used to work on 9.3. On a M2M relationship, adding an existing item shows a blank item in the field. After saving, the item is correctly displayed.

Field before adding item:
image

Field after adding existing item:
image

Field after saving (properly displayed):
image

I have tried redefining the Display Template but the error persists.

I asked a few times in the Discord if anyone else saw this error, finally had someone else confirm this bug. I haven't seen any other posts about it so I thought I would try creating a report.

To Reproduce

  • Create a M2M relationship on 9.4.x and use a field from the related item in the display template.
  • Use the 'add existing' button to add an item, the field will be bugged until save

Errors Shown

There are no bugs shown in the browser console or the Directus server logs.

There also isn't a request shown in the Directus server logs on item select. Not sure if a request should be firing or not.

What version of Directus are you using?

9.4.2

What version of Node.js are you using?

v16.13.0

What database are you using?

Postgres 12

What browser are you using?

Chrome / Firefox

What operating system are you using?

Windows 10

How are you deploying Directus?

Self install on Digital Ocean droplet with a managed DB instance

@Attacler

This comment has been minimized.

@HitomiTenshi
Copy link
Contributor

HitomiTenshi commented Jan 8, 2022

I can confirm this bug happens on simple M2M fields even without deeply nested display configuration, but only when using "Add existing"!

Related to #10647

When using "Add new" on simple M2M fields, the newly added entry displays fine. When using nested (at least 2 relations deep) fields in the display config they will not display even when using "Add new", see issue #10647.

@koksikus

This comment has been minimized.

@StephenGunn

This comment has been minimized.

@koksikus
Copy link

Hi,
What is the cost of this visual fix? or when will it happen?
It would be good to have it. That's why I stopped updating directus...

@benhaynes
Copy link
Sponsor Member

@koksikus You can reach out to our Support Team via our website's Live Chat to get pricing on this. 👍

@vtugulbaev
Copy link

Hi!
I got a similar problem with M2M when linking to files (directus_files). In my case, the application completely crashes due to an unhandled exception.

@benhaynes, i have fixed this error. I can make a pull request. Or how should I post a fix? I'm new to open source =)

@benhaynes
Copy link
Sponsor Member

@vtugulbaev — thank you!! @rijkvanzanten can confirm, but here are our Docs on PRs: https://docs.directus.io/contributing/introduction/#submitting-a-pull-request

@DavidPLamas
Copy link

This issue is still happening in version 9.5.1.
I see that the PR opened by @vtugulbaev hasn't gotten any feedback yet, are there any predictions on when this will be tackled?

@jamescammarano
Copy link
Contributor

Unfortunately, we can not provide estimates on features or fixes. We recognize that this may be an important feature/fix, but we are a small open-source organization with a lot to triage and complete.


This is an automated response.

@Pachat

This comment was marked as duplicate.

@abdonrd
Copy link
Contributor

abdonrd commented Feb 23, 2022

Following this issue, since I also suffer from it.

And thanks @vtugulbaev for the PR!

@ClementRocket
Copy link

ClementRocket commented Mar 31, 2022

Really loooking forward for a solution to this problem. Thanks a lot @vtugulbaev for the PR, I hope it's accepted soon. Thank you guys.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet