From fc5067ebebd86f050c7d48a058f57c369ea7375b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Mon, 22 Sep 2025 19:12:10 +0200 Subject: [PATCH] Editor error fix --- src/Controller/ArticleController.php | 6 ++++-- templates/pages/editor.html.twig | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Controller/ArticleController.php b/src/Controller/ArticleController.php index b9c7200..2913cb3 100644 --- a/src/Controller/ArticleController.php +++ b/src/Controller/ArticleController.php @@ -164,8 +164,10 @@ class ArticleController extends AbstractController if ($article->getPubkey() === null) { $user = $this->getUser(); $key = new Key(); - $currentPubkey = $key->convertToHex($user->getUserIdentifier()); - $article->setPubkey($currentPubkey); + if (!!$user) { + $currentPubkey = $key->convertToHex($user->getUserIdentifier()); + $article->setPubkey($currentPubkey); + } } $form = $this->createForm(EditorType::class, $article, ['action' => $formAction]); diff --git a/templates/pages/editor.html.twig b/templates/pages/editor.html.twig index c37f626..a940e60 100644 --- a/templates/pages/editor.html.twig +++ b/templates/pages/editor.html.twig @@ -13,6 +13,9 @@ {% block body %}
+
+ Log in is required to post articles. +