feat: drop ENABLE_MKTG_SITE flag and MKTG_URL_LINK_MAP setting#38720
Open
feanil wants to merge 10 commits into
Open
feat: drop ENABLE_MKTG_SITE flag and MKTG_URL_LINK_MAP setting#38720feanil wants to merge 10 commits into
feanil wants to merge 10 commits into
Conversation
022fef1 to
28e34b7
Compare
feanil
commented
Jun 5, 2026
| Verify the correct about URL base is used when neither social sharing URL nor | ||
| marketing URL is set (catalog MFE URL vs LMS root URL). | ||
| """ | ||
| self.course_overview.marketing_url = None |
Contributor
Author
There was a problem hiding this comment.
Note for reviewer:
setUp always sets marketing_url = 'test_marketing_url'. Previously, an ENABLE_MKTG_SITE gate in
get_link_for_about_page prevented that value from being used, so the test happened to reach the
fallback path anyway. After removing the gate, marketing_url is checked unconditionally, so the test
has to explicitly clear it to force the function into the fallback path it's actually testing.
feanil
added a commit
that referenced
this pull request
Jun 8, 2026
The E003 check required MKTG_URLS['ROOT'] to be defined, but this key
is optional. The index() view in branding/views.py already handles the
case where ROOT is absent:
root_url = marketing_urls.get("ROOT")
if root_url and root_url != getattr(settings, "LMS_ROOT_URL", None):
return redirect(root_url)
Previously, E003 was only triggered when ENABLE_MKTG_SITE=True (the
check was guarded by that flag). After removing ENABLE_MKTG_SITE in
#38720, the check runs
unconditionally and fires in any environment where MKTG_URLS has no
ROOT key (including test and CMS environments). Since ROOT is genuinely
optional, the check is incorrect and should not be enforced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feanil
added a commit
that referenced
this pull request
Jun 11, 2026
The E003 check required MKTG_URLS['ROOT'] to be defined, but this key
is optional. The index() view in branding/views.py already handles the
case where ROOT is absent:
root_url = marketing_urls.get("ROOT")
if root_url and root_url != getattr(settings, "LMS_ROOT_URL", None):
return redirect(root_url)
Previously, E003 was only triggered when ENABLE_MKTG_SITE=True (the
check was guarded by that flag). After removing ENABLE_MKTG_SITE in
#38720, the check runs
unconditionally and fires in any environment where MKTG_URLS has no
ROOT key (including test and CMS environments). Since ROOT is genuinely
optional, the check is incorrect and should not be enforced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d47f2e0 to
53eba85
Compare
…lution ENABLE_MKTG_SITE was a feature flag that selected between two URL resolution strategies: MKTG_URLS (external marketing site) vs MKTG_URL_LINK_MAP (local Django URL reversal). The local-template path is now legacy; all operators are expected to use MKTG_URLS. This commit removes the flag and its conditional branches, keeping the MKTG_URLS-based behaviour unconditionally: - Drop the setting definition and toggle annotation from openedx/envs/common.py - Remove the override from lms/envs/devstack.py and both mock.yml files - Simplify marketing_link() and is_marketing_link_set() in edxmako/shortcuts.py to always consult MKTG_URLS; drop the MKTG_URL_LINK_MAP fallback branches and the now-unused NoReverseMatch/reverse/set_custom_attribute/get_current_request_hostname imports - Update validate_marketing_site_setting() in checks.py to always validate MKTG_URLS rather than gating validation on ENABLE_MKTG_SITE - Trim edxmako/tests.py: remove False-path test variants and the MKTG_URL_LINK_MAP link-reversal test; each remaining test now exercises a single, unconditional code path Part of #37053 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feanil
added a commit
that referenced
this pull request
Jun 22, 2026
The E003 check required MKTG_URLS['ROOT'] to be defined, but this key
is optional. The index() view in branding/views.py already handles the
case where ROOT is absent:
root_url = marketing_urls.get("ROOT")
if root_url and root_url != getattr(settings, "LMS_ROOT_URL", None):
return redirect(root_url)
Previously, E003 was only triggered when ENABLE_MKTG_SITE=True (the
check was guarded by that flag). After removing ENABLE_MKTG_SITE in
#38720, the check runs
unconditionally and fires in any environment where MKTG_URLS has no
ROOT key (including test and CMS environments). Since ROOT is genuinely
optional, the check is incorrect and should not be enforced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4f76506 to
61f465f
Compare
index() (served at /) now unconditionally checks MKTG_URLS['ROOT'] and
redirects when it differs from LMS_ROOT_URL, matching the previous
ENABLE_MKTG_SITE=True behaviour. The catalog MFE redirect
(ENABLE_CATALOG_MICROFRONTEND) still fires first and is unaffected.
Also fixes a pre-existing bug where log.error() in the NoReverseMatch
handler was passed multiple f-strings as positional args, causing a
TypeError when that branch was reached.
courses() (served at /courses) now resolves in priority order:
1. Redirect to the catalog MFE if ENABLE_CATALOG_MICROFRONTEND is set
2. Permanent redirect to marketing_link('COURSES') from MKTG_URLS
3. Render the local course list via courseware.views.views.courses()
The old ENABLE_MKTG_SITE gate and COURSES_ARE_BROWSABLE guard are
removed. The local course list fallback (case 3) preserves behaviour
for operators who have neither the catalog MFE nor MKTG_URLS['COURSES']
configured.
The stanford-style theme footer is updated to use marketing_link()
instead of reverse() for the 'about' and 'tos' URL routes, which are
removed in a later commit.
Tests drop their @override_settings(ENABLE_MKTG_SITE=True) decorators;
the test names and assertions are otherwise unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… API
- course_about_url in enrollment emails now uses
get_link_for_about_page(), resolving the marketing URL, social sharing
URL, or LMS about URL as a fallback
- get_link_for_about_page() uses course.marketing_url unconditionally
- has_marketing_url() returns bool(self.marketing_url) directly
- url_to_enroll() always returns marketing_link('COURSES')
- _course_home_redirect_enabled() only checks ENABLE_COURSE_HOME_REDIRECT;
default changed from True to False because the flag previously had no
effect when ENABLE_MKTG_SITE=False (the old default) — operators who
relied on ENABLE_MKTG_SITE=True to activate the course-about redirect
must now set ENABLE_COURSE_HOME_REDIRECT=True explicitly
- Remove ENABLE_MKTG_SITE patches from courseware, instructor, and
mobile API tests; merge redundant test cases where applicable
BREAKING CHANGE: ENABLE_COURSE_HOME_REDIRECT now defaults to False.
Operators who previously had ENABLE_MKTG_SITE=True and want the
course about page to redirect to the learning MFE must explicitly set
ENABLE_COURSE_HOME_REDIRECT=True in their configuration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Email change confirmation contact link now always comes from
marketing_link('CONTACT') via MKTG_URLS. Remove the fallback that
constructed a local URL when the flag was False.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- contentstore utils: marketing_enabled is always True - registration tests: remove ENABLE_MKTG_SITE=False test cases that tested now-dead local URL generation for honor code and TOS links; remove ENABLE_MKTG_SITE=True decorators from the remaining tests - site_configuration test mixin: remove ENABLE_MKTG_SITE example key - schedules README: remove ENABLE_MKTG_SITE from example config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Marketing navigation links (HOW_IT_WORKS, COURSES, SCHOOLS) are now always rendered in the unauthenticated nav bars. marketing_link() falls back to '#' when a URL is not configured in MKTG_URLS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This setting was the fallback URL resolution mechanism used when ENABLE_MKTG_SITE=False. Now that the flag is gone, only MKTG_URLS is used for marketing link resolution. - Remove MKTG_URL_LINK_MAP definition from openedx/envs/common.py - Remove LMS-specific update block from lms/envs/common.py - Remove test environment override from lms/envs/test.py - Remove YAML loading and dict-update from lms and cms production envs - Remove the dynamic URL registration loop from static_template_view - Remove MKTG_URL_LINK_MAP.keys() union from the marketing link context processor in edxmako/shortcuts.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the 14 template files that were served locally when ENABLE_MKTG_SITE=False. These pages (about, blog, contact, donate, faq, help, honor, jobs, media-kit, news, press, privacy, tos, sitemap.xml) should now only live on the external marketing site configured via MKTG_URLS. Also remove the stanford-style theme overrides for about.html and tos.html, the hardcoded URL patterns for the deleted templates, the honor.html iframing special case from the render view, and the tests that exercised these now-deleted routes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The E003 check required MKTG_URLS['ROOT'] to be defined, but this key
is optional. The index() view in branding/views.py already handles the
case where ROOT is absent:
root_url = marketing_urls.get("ROOT")
if root_url and root_url != getattr(settings, "LMS_ROOT_URL", None):
return redirect(root_url)
Previously, E003 was only triggered when ENABLE_MKTG_SITE=True (the
check was guarded by that flag). After removing ENABLE_MKTG_SITE in
#38720, the check runs
unconditionally and fires in any environment where MKTG_URLS has no
ROOT key (including test and CMS environments). Since ROOT is genuinely
optional, the check is incorrect and should not be enforced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ails
With ENABLE_MKTG_SITE removed, get_email_params() now always sets
course_about_url via get_link_for_about_page(), which never returns None
(it falls back to the LMS course about URL). The instructor "allowed
enroll" and "add beta tester" ACE email templates branched on
`course_about_url is not None`, keeping an else-branch for the old
marketing-site-enabled case where course_about_url was None.
Those conditionals are now always true and their else-branches are dead:
- allowedenroll: "You can then enroll in {{ course_name }}."
- addbetatester: "Visit {{ site_name }} to enroll in this course and
begin the beta test."
Collapse the always-true `course_about_url is not None` guards to the
unconditional branch and delete the unreachable text (both .txt and .html
variants). No behavior change for any reachable input.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61f465f to
6c2a280
Compare
feanil
commented
Jun 22, 2026
| Verifies that we will redirect the learner to the URL returned from the `check_for_unacknowledged_notices` | ||
| function. | ||
| """ | ||
| mock_notices.return_value = reverse("about") |
Contributor
Author
There was a problem hiding this comment.
The about page was removed so this test was previously breaking. Switched to the root which still returns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #37053.
Removes the
ENABLE_MKTG_SITEfeature flag, the companionMKTG_URL_LINK_MAPsetting, and the legacy static marketing templates that were served locally whenENABLE_MKTG_SITE=False. All code now behaves as if the flag were alwaysTrue— marketing links resolve viaMKTG_URLSonly.BREAKING CHANGES
ENABLE_MKTG_SITEsetting removed.Any operator configuration that sets
ENABLE_MKTG_SITE(in YAML, environment variables, orSiteConfiguration) will have that value silently ignored. Code that readssettings.FEATURES.get('ENABLE_MKTG_SITE')orsettings.ENABLE_MKTG_SITEwill getNone/AttributeErrorrespectively. EnsureMKTG_URLSis configured as the replacement before upgrading.MKTG_URL_LINK_MAPsetting removed.Any operator configuration that sets
MKTG_URL_LINK_MAPwill have it silently ignored. Marketing links now resolve exclusively viaMKTG_URLS.ENABLE_COURSE_HOME_REDIRECTdefault changed fromTruetoFalse.Previously this flag only had effect when
ENABLE_MKTG_SITE=True, so it was silently ignored by most operators. Now thatENABLE_MKTG_SITEis removed, it is the sole gate controlling whether/courses/<id>/aboutredirects to the learning MFE course home instead of rendering the about page HTML.The default is
Falseto preserve existing behavior for operators who were not usingENABLE_MKTG_SITE=True. Operators who previously hadENABLE_MKTG_SITE=Trueand relied on the course-about-to-MFE redirect must now explicitly setENABLE_COURSE_HOME_REDIRECT=Trueto preserve that behavior.Deleted marketing template URL routes.
The following URL names no longer exist — direct references such as
reverse('about')orreverse('tos')will raiseNoReverseMatch:about,blog,contact,donate,faq,help,honor,jobs,media-kit,news,press,privacy,tos,sitemap.xmlUse
marketing_link('ABOUT'),marketing_link('TOS'), etc. instead, which resolve viaMKTG_URLS.What is NOT changed
MKTG_URLSandMKTG_URL_OVERRIDESsettings (the replacement mechanism)press_releaseURL pattern (servespress_releases/directory)/coursesURL route — now resolves via catalog MFE →MKTG_URLS['COURSES']→ local course list pageMFE impact and follow-up
The CMS course settings API (
GET /api/contentstore/v1/course_settings/{course_id}) includes amarketing_enabledfield previously driven byENABLE_MKTG_SITE. It now always returnsTrue, which changes the UI shown infrontend-app-authoring's Schedule & Details page from an enrollment card to a dismissible promotional banner.Follow-up PR in
frontend-app-authoring(#3088): removes themarketingEnabledconditional, always renders the banner, and exportsCoursePromotionCardso operators can restore the old enrollment card viaPageBannerSlotif needed. Themarketing_enabledAPI field andCoursePromotionCardwill be fully removed in the "Y" release (tracked in #38727).