[File] Fix file deletion violating foreign keys

This commit is contained in:
Alexei Sorokin
2020-08-13 23:56:31 +03:00
committed by Diogo Peralta Cordeiro
parent 8fc807343b
commit e62e429302
2 changed files with 18 additions and 13 deletions

View File

@@ -440,6 +440,12 @@ class EmbedPlugin extends Plugin
return !file_exists($imgPath);
}
public function onFileDeleteRelated(File $file, array &$related): bool
{
$related[] = 'File_embed';
return true;
}
/**
* @return bool false on no check made, provider name on success
* @throws ServerException if check is made but fails