Skip to content

Commit 9bfdfeb

Browse files
authored
fix: remove the "Legacy Library" button if libraries v1 are disabled (openedx#35736)
Removes the "Legacy Library" button from the legacy Studio "new block" button array if Libraries v1 are disabled, either via waffle flag or via the ENABLE_CONTENT_LIBRARIES feature flag.
1 parent 5904b54 commit 9bfdfeb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cms/djangoapps/contentstore/views/component.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xblocks
2727
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
2828
from cms.djangoapps.contentstore.helpers import is_unit
29-
from cms.djangoapps.contentstore.toggles import libraries_v2_enabled, use_new_problem_editor, use_new_unit_page
29+
from cms.djangoapps.contentstore.toggles import (
30+
libraries_v1_enabled,
31+
libraries_v2_enabled,
32+
use_new_problem_editor,
33+
use_new_unit_page,
34+
)
3035
from cms.djangoapps.contentstore.xblock_storage_handlers.view_handlers import load_services_for_studio
3136
from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside
3237
from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration
@@ -488,6 +493,8 @@ def _filter_disabled_blocks(all_blocks):
488493
Filter out disabled xblocks from the provided list of xblock names.
489494
"""
490495
disabled_block_names = [block.name for block in disabled_xblocks()]
496+
if not libraries_v1_enabled():
497+
disabled_block_names.append('library')
491498
if not libraries_v2_enabled():
492499
disabled_block_names.append('library_v2')
493500
disabled_block_names.append('itembank')

0 commit comments

Comments
 (0)