Skip to content
Snippets Groups Projects
Commit 015ec361 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

remove translations after config value was removed, fixes #1597

Closes #1597

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