3.1 Remote API - sites_web_domain_add: missing event listener for 'sites:web_domain:on_after_insert'
Branch: stable-3.1
Problem: After creating a website remotely with the 'sites_web_domain_add' call, there in an event fired (sites:web_domain:on_after_insert), which is not registered anywhere. Because of this the document_root, system_user, system_group and php_open_basedir values will not get set up for the created website.
Possible solution: Registering the missing event in the sites_web_vhost_domain_plugin class onLoad() function seems to solve the problem.
function onLoad() {
global $app;
//Register for the events
$app->plugin->registerEvent('sites:web_vhost_domain:on_after_insert', 'sites_web_vhost_domain_plugin', 'sites_web_vhost_domain_edit');
$app->plugin->registerEvent('sites:web_vhost_domain:on_after_update', 'sites_web_vhost_domain_plugin', 'sites_web_vhost_domain_edit');
//Register the missing event.
$app->plugin->registerEvent('sites:web_domain:on_after_insert', 'sites_web_vhost_domain_plugin', 'sites_web_vhost_domain_edit');
}