Multireference fields do not delete cleanly

Steps to reproduce:

  1. Create two collections {A,B}

  2. Add a multireference field in A referencing B (I called mine CollectionB)

  3. B will automatically have a multireference field linking back to A (Called CollectionA)

  4. Delete B’s multireference field to A

  5. Neither A nor B have a multireference field

  6. Add a multireference field in A referencing B using the same field name as in Step 2.

  7. B will not have a multireference field linking back to A (this is not expected).

  8. Add a multireference field in A referencing B using a different field name (I called mine NewCollectionB)

  9. Collection B automatically generates a multiference field, but this time it is called CollectionA-1.

That suggests to me that field references (or at least back references) are not actually being deleted, they are just being hidden. I would like to delete my multi-references (or any arbitrary field) and know with certainty that the field has been obliterated from existence.

I have an issue right now where I am unable to insert reference fields between two tables using wix-data and I am concerned that the linking between the tables has been corrupted due to deleting and recreating references as described above.

I would like the freedom to create and delete references without corrupting my collections. When I delete something, I want it to be deleted.

Hi Trevor!

#7 definitely sounds like an issue. Can you share the affected site? (You can do this via personal message too).

1 Like

How do I send you a PM?

@trevorwilson Unfortunately we don’t have member chat yet. Would you post the URL here?

1 Like

@marlowe-shaeffer

Sure, I don’t see any harm in that. Note, that I am not the owner of this site, I am just helping with development. In my sandbox, I created the collections, CollectionA and CollectionB. That was just for demonstration purposes, the problem happens with any of my collections.

URL: https://www.qualityconnect.ca/

Here is another observation. When adding a mult-reference, the corresponding back reference is automatically given an ID in pascal case. The pascal case foreign key does not appear to be recognized by the collections view (at the very least), which normally assigns a camel case identifier. If I use wix-data to insert a record into CollectionB and set the CollectionA mult-reference field using the field ID “CollectionA”, then the inserted record will show a blank under CollectionA, but if I instead insert the CollectionA ID in a field ID named collectionA (camel case), then the inserted record in CollectionB will include a new field named “collectionA” and the field’s value will be correctly set to the ID of CollectionA.

@marlowe-shaeffer , has anyone looked into this issue at all? It might be related to another issue I am seeing with multi-reference linked collections.

Hi Trevor,

thank you for reporting these. We have found the reason for it and are fixing it. I will update once this is resolved.

1 Like

@giedrius-grazevicius Is there an ETA?

@marlowe-shaeffer I was wondering if there is an ETA on this? As described by my post on Feb 7th, using wix-data to save or insert multi-reference records is broken. I need this functionality to work for my project. Since @giedrius-grazevicius had mentioned that a fix is being developed, I would like to know the ETA so that I can make important decisions regarding the future of this project.

Thank you.

Hi, Trevor,

the issue regarding deleting and restoring fields incorrectly is now fixed. Adding and displaying multi-references from both sides of the relationship should work correctly now. Existing fields that were created during the issue may exhibit non-standard behavior. Please let us know if you need help in fixing your site.

However, restoring the field (also creating it with the same name) will restore the data. Complete data removal is something we want to address in the future, but we can’t share an ETA at this time.

If you are still experiencing any other issues with newly created multi-reference fields, please update us in this thread. Thank you.

Hi, Trevor,

the issue regarding deleting and restoring fields incorrectly is now fixed. Adding and displaying multi-references from both sides of the relationship should work correctly now. Existing fields that were created during the issue may exhibit non-standard behavior. Please let us know if you need help in fixing your site.

However, restoring the field (also creating it with the same name) will restore the data. Complete data removal is something we want to address in the future, but we can’t share an ETA at this time.

If you are still experiencing any other issues with newly created multi-reference fields, please update us in this thread. Thank you.

1 Like

Thank you @giedrius-grazevicius !

I will be working on this over the weekend and will report back. I appreciate the update.

Cheers!