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

Adding the same node object as a child to multiple topics results in multiple nodes with the same node_id #354

Open
rtibbles opened this issue Jan 28, 2022 · 0 comments
Milestone

Comments

@rtibbles
Copy link
Member

  • ricecooker version: 0.7.0b2
  • Python version: Python 3.9
  • Operating System: Ubuntu Linux

Observed Behaviour

If attempting to repeat a node in multiple places in a topic tree, it seems natural to be able to add it as the child of multiple TopicNodes. Indeed, ricecooker allows you to do this, and even makes the topic tree in this format appear on Studio.

However, because the nodes objects are shared between the two locations, the node_id is recalculated for the last occurring location, but all occurrences of the node then share that node_id.

This means that the topic tree appears to be properly formatted on Studio, where each node has a distinct primary key, but once published to Kolibri where the node_id is the primary key, the node will only appear in the last location in the tree, as that will be the last one written to the SQLite database during publishing.

Expected Behaviour

If this is allowed, then ricecooker should internally clone nodes that are added in multiple locations in the tree.

Otherwise, it should give an error when this happens and exit.

@rtibbles rtibbles added this to the 0.8 milestone Oct 4, 2022
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

1 participant