amtrack / sfdx-browserforce-plugin

sfdx plugin for browser automation
MIT License
109 stars 37 forks source link

fix: Enabling communities (Lightning Experience Sites) no longer requires specifying a domain name #554

Closed YodaDaCoda closed 1 year ago

YodaDaCoda commented 1 year ago

Also includes a minor change to allow building the plugin on Windows

amtrack commented 1 year ago

Thanks @YodaDaCoda , good catch!

Unfortunately I couldn't get the unit tests passing locally.

But maybe this can even be done without browser automation. I implemented this in March 2019 https://github.com/amtrack/sfdx-browserforce-plugin/pull/122. It looks like enableNetworksEnabled is available since API v47.0 (Winter 20) CommunitiesSettings Metadata

settings/Communities.settings-meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<CommunitiesSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableNetworksEnabled>true</enableNetworksEnabled>
</CommunitiesSettings>
sfdx force:source:deploy -p settings/Communities.settings-meta.xml

I just did this in a Scratch Org and it seemed to have worked. But I don't know if there are any side effects.

Could you please check?

YodaDaCoda commented 1 year ago

Interesting, thanks. I'll give this a go later and report back.

YodaDaCoda commented 1 year ago

Yep looks like this can be done via the matadata API - needs to be done before a deployment including sites/networks/experiences; activating can't be done in the same deploy.