Skip to content
Snippets Groups Projects

fixed

1 file
+ 10
14
Compare changes
  • Side-by-side
  • Inline
@@ -169,7 +169,7 @@ class ConfigSplitIgnoreFilter extends IgnoreFilter {
*/
public function filterExists($name, $exists) {
// If the name is a deleted config, treat it as not existing.
if (in_array(static::DELETION_PREFIX . $name, $this->configuration['ignored'], TRUE)) {
if (!empty($this->configuration['ignored']) && in_array(static::DELETION_PREFIX . $name, $this->configuration['ignored'], TRUE)) {
return FALSE;
}
@@ -182,28 +182,24 @@ class ConfigSplitIgnoreFilter extends IgnoreFilter {
* {@inheritdoc}
*/
public function filterListAll($prefix, array $data) {
// Ensure $this->configuration['ignored'] is treated as an array.
$ignoredConfigs = !empty($this->configuration['ignored']) && is_array($this->configuration['ignored']) ? $this->configuration['ignored'] : [];
foreach ($data as $key => $config_name) {
// If the name is a deleted config, treat it as not existing.
if (in_array(static::DELETION_PREFIX . $config_name, $this->configuration['ignored'], TRUE)) {
if (in_array(static::DELETION_PREFIX . $config_name, $ignoredConfigs, TRUE)) {
unset($data[$key]);
}
}
if (!empty($this->getFilteredStorage()->getCollectionName())) {
// In collections, treat config as existing
// if it is ignored and exists in the active storage.
if (!empty($this->getFilteredStorage()->getCollectionName()) && !empty($this->active)) {
$active_names = $this->active->listAll($prefix);
$data = array_unique(array_merge($data, array_filter($active_names,
[
$this,
'matchConfigName',
]
)));
$data = array_unique(array_merge($data, array_filter($active_names, [$this, 'matchConfigName'])));
}
// Allow to delete the configuration if the split becomes inactive.
return $data;
}
/**
* {@inheritdoc}
Loading