Change snipConent entitie property to public
This commit is contained in:
@@ -18,10 +18,10 @@ class SnipContentController extends AbstractController
|
||||
#[Route('/compare/{to}/{from}', name: '_compare')]
|
||||
public function compare(SnipContent $to, ?SnipContent $from = null): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(SnipVoter::VIEW, $to->getSnip());
|
||||
$this->denyAccessUnlessGranted(SnipVoter::VIEW, $to->snip);
|
||||
|
||||
if ($from === null) {
|
||||
$from = $to->getParent();
|
||||
$from = $to->parent;
|
||||
}
|
||||
|
||||
$diff = MyersDiff::buildDiffLines(
|
||||
@@ -30,8 +30,8 @@ class SnipContentController extends AbstractController
|
||||
);
|
||||
|
||||
return $this->render('content/compare.html.twig', [
|
||||
'snip' => $to->getSnip(),
|
||||
'snip' => $to->snip,
|
||||
'diff' => $diff,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ class VersionController extends AbstractController
|
||||
$this->denyAccessUnlessGranted(SnipVoter::EDIT, $snip);
|
||||
|
||||
$this->contentService->setVersion($snip, $version);
|
||||
$this->addFlash('success', 'Snip version set to ' . $version->getId());
|
||||
$this->addFlash('success', 'Snip version set to ' . $version->id);
|
||||
return $this->redirectToRoute('snip_single', ['snip' => $snip->id]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user