- Issue created by @mglaman
When calling setBackendConfig, the backend plugin has no way to react to the configuration change unless it has been initialized.
#[ActionMethod(adminLabel: new TranslatableMarkup('Set backend config'), pluralize: FALSE)]
public function setBackendConfig(array $backend_config) {
$this->backend_config = $backend_config;
// In case the backend plugin is already loaded, make sure the configuration
// stays in sync.
if ($this->backendPlugin
&& $this->getBackend()->getConfiguration() !== $backend_config) {
$this->getBackend()->setConfiguration($backend_config);
}
return $this;
}
See β¨ Determine host, context, and core from update_endpoint on setConfiguration as well Active using a recipe to set configuration for SearchStax using inputs and setBackendConfig
Always load the backend plugin and set its configuration
#[ActionMethod(adminLabel: new TranslatableMarkup('Set backend config'), pluralize: FALSE)]
public function setBackendConfig(array $backend_config) {
$this->getBackend()->setConfiguration($backend_config);
$this->backend_config = $this->getBackend()->getConfiguration();
return $this;
}
Active
1.0
General code