Skip to content
Snippets Groups Projects
Commit 93fb3b44 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

remove translations after config value was removed, fixes #1597

Closes #1597

Merge request studip/studip!1029
parent d2757abc
No related branches found
No related tags found
No related merge requests found
...@@ -26,10 +26,18 @@ class ConfigValue extends SimpleORMap ...@@ -26,10 +26,18 @@ class ConfigValue extends SimpleORMap
protected static function configure($config = []) protected static function configure($config = [])
{ {
$config['db_table'] = 'config_values'; $config['db_table'] = 'config_values';
$config['belongs_to']['entry'] = [ $config['belongs_to']['entry'] = [
'class_name' => \ConfigEntry::class, 'class_name' => \ConfigEntry::class,
'foreign_key' => 'field', 'foreign_key' => 'field',
]; ];
$config['registered_callbacks']['after_delete'][] = function (ConfigValue $value) {
if ($value->entry->type === 'i18n') {
$value->getTypedValue()->removeTranslations();
}
};
parent::configure($config); parent::configure($config);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment