SocialContentBlockLandingPageConfigOverride.php in Open Social 10.2.x
File
modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php
View source
<?php
namespace Drupal\social_content_block_landing_page;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
class SocialContentBlockLandingPageConfigOverride implements ConfigFactoryOverrideInterface {
protected $configFactory;
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
public function loadOverrides($names) {
$overrides = [];
$config_name = 'field.field.paragraph.section.field_section_paragraph';
if (in_array($config_name, $names)) {
$dependencies = $this->configFactory
->getEditable($config_name)
->get('dependencies.config');
$dependencies[] = 'paragraphs.paragraphs_type.custom_content_list';
$overrides[$config_name] = [
'dependencies' => [
'config' => $dependencies,
],
'settings' => [
'handler_settings' => [
'target_bundles' => [
'custom_content_list' => 'custom_content_list',
],
'target_bundles_drag_drop' => [
'custom_content_list' => [
'enabled' => TRUE,
'weight' => 17,
],
],
],
],
];
}
return $overrides;
}
public function getCacheSuffix() {
return 'SocialContentBlockLandingPageConfigOverride';
}
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}