Merge branch 'master' into PHRAS-2979-41-fix-right-access

This commit is contained in:
Nicolas Maillat
2020-03-18 10:27:58 +01:00
committed by GitHub
24 changed files with 337 additions and 93 deletions

View File

@@ -19,6 +19,7 @@ use Alchemy\Phrasea\Core\Event\Record\OriginalNameChangedEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\StatusChangedEvent;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Core\PhraseaTokens;
use Alchemy\Phrasea\Databox\Subdef\MediaSubdefRepository;
use Alchemy\Phrasea\Filesystem\FilesystemService;
@@ -284,7 +285,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$this->getDataboxConnection()->executeUpdate($sql, ['type' => $type, 'record_id' => $this->getRecordId()]);
if ($old_type !== $type) {
$this->rebuild_subdefs();
$this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($this));
}
$this->type = $type;
@@ -341,7 +342,8 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
array(':mime' => $mime, ':record_id' => $this->getRecordId())
)) {
$this->rebuild_subdefs();
$this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($this));
$this->delete_data_from_cache();
}