Skip to content

🛠️ Fix: update value with full path when creating new note in relation field #1093

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

IgniKSJ
Copy link

@IgniKSJ IgniKSJ commented Mar 23, 2025

🐛 Problem
When creating a new note via a Relation column with the bidirectional option enabled, the new note is successfully created in the related database — but the selected option’s value is not updated with the full path to the note. This results in a broken bidirectional relation and an error in the console.

💥 How to Reproduce
Create a Relation column in a DB Folder database with the bidirectional option enabled.

In the table view, go to a cell in that Relation column, type the name of a new note (that doesn't yet exist).

Click Create "note name" when prompted.

Click outside the cell.

Observe:

A console error is thrown.

The new note is created, but the relation option isn't properly updated (value is incomplete), so the bidirectional link fails.

✅ Fix Summary
Modified RelationalServiceInstance.createNoteIntoRelation to return the full path of the newly created note.

In RelationEditor.handleOnChange, during the create-option action, the returned path is now assigned to the correct value field in the newValue array, ensuring the relation is fully functional.

📷 Screenshots (Bug Reproduction)
Screenshot 01 – Relation Settings
Shows the configuration of the relation column with bidirectional enabled.

Screenshot 02 – Creating a New Note in the Related Database
Typing a new note name and selecting Create "note name".

Screenshot 03 – Clicking Away
After clicking away, the note is created but a console error appears. The relation value is not updated correctly.

(Screenshots attached below)

Screenshot 01 - Relation Settings
{61350E88-7F5F-46C5-AC2C-D92C8F629995}

Screenshot 02 - Creating a new note in the related database
{E0F3E71A-8C91-4D8F-BECD-0751D6B781D2}

Screenshot 03 - Clicking away
{81BC9B47-5ABD-4A44-A532-4E158E9B2DB3}

PS: Tis is the first PR i send to a public repo, so let me know anything i could do to make it work for you, i would be very grateful. Thank you for your work making this useful plugin!

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

Successfully merging this pull request may close these issues.

1 participant