Allow to show collection elements that were deleted before by timetravel

This commit is contained in:
Jan Böhmer 2020-02-29 22:53:53 +01:00
parent b5bc096972
commit f604022e49
9 changed files with 386 additions and 78 deletions

View file

@ -96,16 +96,6 @@ class PartController extends AbstractController
{
$this->denyAccessUnlessGranted('read', $part);
$table = $dataTable->createFromType(LogDataTable::class, [
'filter_elements' => $historyHelper->getAssociatedElements($part),
'mode' => 'element_history'
], ['pageLength' => 10])
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
}
$timeTravel_timestamp = null;
if ($timestamp !== null) {
//If the timestamp only contains numbers interpret it as unix timestamp
@ -118,6 +108,16 @@ class PartController extends AbstractController
$timeTravel->revertEntityToTimestamp($part, $timeTravel_timestamp);
}
$table = $dataTable->createFromType(LogDataTable::class, [
'filter_elements' => $historyHelper->getAssociatedElements($part),
'mode' => 'element_history'
], ['pageLength' => 10])
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
}
return $this->render(
'Parts/info/show_part_info.html.twig',
[