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

Media domain support for switch_to_blog() #97

Merged
merged 13 commits into from
May 2, 2022

Conversation

cameronterry
Copy link
Owner

A rethink of the DM_Media to get it working with switch_to_blog(). Media domains functionality is now more aware of the context switches and now has the capability to retrieve settings on a per site basis and recall them when needed.

Also DarkMatter_Domains no longer has a hard requirement for the DM_NETWORK_MEDIA constant to be the only way to hard-code the media domains. Using DarkMatter_Domains::instance()->network_media property now affords the opportunity for more sophisticated logic to be applied - for example: someone could theoretically group sites together and serve them on a specific set of CDN domains for media assets. This is now easier to achieve that running the risk of accidentally defining the DM_NETWORK_MEDIA constant more than once.

This PR resolves the following unit test errors / warnings:

1) MappingDomainsTest::test_attachment_src
Failed asserting that false is not false.

/home/runner/work/dark-matter/dark-matter/tests/phpunit/domain-mapping/MappingDomainsTest.php:121

2) MappingDomainsTest::test_feature_image
Failed asserting that false is not false.

/home/runner/work/dark-matter/dark-matter/tests/phpunit/domain-mapping/MappingDomainsTest.php:148

Fixes: #91

@cameronterry cameronterry self-assigned this May 2, 2022
@cameronterry cameronterry mentioned this pull request May 2, 2022
@cameronterry cameronterry merged commit 5d5d087 into release/2.3.0 May 2, 2022
@cameronterry cameronterry deleted the fix/media-domains-switch-blog branch May 2, 2022 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant