You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"As a content author, when I duplicate an XBlock that has tags applied, the newly created XBlock through duplication should also have the tags carried over and applied"
Acceptance Criteria
This step implements changes needed to handle the "duplicate xblock" case, as the logic slightly differs from the copy/paste case. This comes after completed the implementation for pasting XBlocks, and adds additional changes needed.
In the duplicate_block function, we can add a new kwarg called “with_tags=True” that will (by default) copy over the tags from the xblock (and its children if shallow=False) that is being duplicated
That function calls the gather_block_attributes function, which we can pass in the new with_tags kwarg, in this case we default to False so it doesnt affect other calls to this function. If set to True, we can fetch the tags for that xblock using the get_tags_content API method, similar to Step 1 and include the results in the duplicate_metadata that is returned
Once the new duplicated xblock is created using store.create_item, we can then apply all the returned tags to the new xblock using tag_content_object method
The same steps will be repeated for the children since the duplicate_block function will be called recursively, so it handles that case if we pass in the same with_tags kwarg value.
Implement tests to verify this was implemented correctly
The text was updated successfully, but these errors were encountered:
"As a content author, when I duplicate an XBlock that has tags applied, the newly created XBlock through duplication should also have the tags carried over and applied"
Acceptance Criteria
This step implements changes needed to handle the "duplicate xblock" case, as the logic slightly differs from the copy/paste case. This comes after completed the implementation for pasting XBlocks, and adds additional changes needed.
with_tags
kwarg, in this case we default to False so it doesnt affect other calls to this function. If set to True, we can fetch the tags for that xblock using the get_tags_content API method, similar to Step 1 and include the results in theduplicate_metadata
that is returnedduplicate_block
function will be called recursively, so it handles that case if we pass in the samewith_tags
kwarg value.The text was updated successfully, but these errors were encountered: