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

"Link Existing" displays inconsistent results #57

Open
lbradley-mm opened this issue Apr 7, 2021 · 1 comment
Open

"Link Existing" displays inconsistent results #57

lbradley-mm opened this issue Apr 7, 2021 · 1 comment

Comments

@lbradley-mm
Copy link

Although the DB is updated correctly the return'd HTML from the POST shows (none) until you refresh the screen

When clicking "Link Existing" it makes 2 calls to set the relationship, the first one consistently shows (none) the second can be more of a race condition.

@christopherdarling
Copy link

this appears to be caused by https://github.com/silvershop/silverstripe-hasonefield/blob/main/client/src/legacy/hasonefield.js#L7-L12 there are two network requests called onclick, the code here to refresh the gridfield often executes before the database is updated with the new relation. a crude fix is adding a timeout sufficient for the other request to complete, maybe there is a better JS event that should be used instead of onclick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants