directus/v6-archive

Uncaught TypeError: e.startTracking is not a function when trying to open a M2O field before saving the parent

オープン

#25 opened on 2018/10/25

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (4 件のフォーク)auto 404
3. MajorInterfacebughelp wantedv6

Repository metrics

Stars
 (2 個のスター)
PR merge metrics
 (PR metrics pending)

説明

From directus created by iKonrad : directus/directus#2023

Hi all

Thanks for the amazing library, I'm stoked on how flexible and versatile this tool is.

I'm having an issue with a Many to one relationship here.

Version Info

  • Directus version and branch: 93ceb86f3171e7369d6bd376d2cd8c13024edd28
  • PHP version: 7.1.12
  • MySQL version: mysql Ver 14.14 Distrib 5.7.20
  • Web server: Apache
  • OS name and version: Ubuntu 16

Expected Behavior

Actual Behavior

So, let's say we have a User and Addresses tables.

On Addresses, I've added an INT field with a M2O relationship to the User, with an option to Add addresses and Choose from existing dynamically. The problem is when you want to create a new user, add a new address (saves just fine), then go back to the unsaved user and click on the Address again (without saving the user), the JavaScript will fail with the following error:

image

Steps to Reproduce

  1. Create a User table
  2. Create an Addresses table
  3. On Addresses table, create an INT column and set it up as a M2O relationship to user
  4. On User table, create a One-to-many relationship and point to Addresses table. Also, make sure to have Add Button, Choose Button, Remove Button options selected in Interface options.
  5. Now, go to the Users section and open the "New item" menu.
  6. Add a new address item in the menu, save the address to get back to the New user menu.
  7. Now, without hitting the save button for the user, click on the Address that you have just created.

Something worth mentioning: If, after the step 6, you saved the User item and opened it again, you could access the address property just fine.

Schema Dump, Logs, or Screenshots

No logs available as this is a JS issue.

コントリビューターガイド