Browse Source

Editor error fix

imwald
Nuša Pukšič 4 months ago
parent
commit
fc5067ebeb
  1. 2
      src/Controller/ArticleController.php
  2. 3
      templates/pages/editor.html.twig

2
src/Controller/ArticleController.php

@ -164,9 +164,11 @@ class ArticleController extends AbstractController @@ -164,9 +164,11 @@ class ArticleController extends AbstractController
if ($article->getPubkey() === null) {
$user = $this->getUser();
$key = new Key();
if (!!$user) {
$currentPubkey = $key->convertToHex($user->getUserIdentifier());
$article->setPubkey($currentPubkey);
}
}
$form = $this->createForm(EditorType::class, $article, ['action' => $formAction]);
$form->handleRequest($request);

3
templates/pages/editor.html.twig

@ -13,6 +13,9 @@ @@ -13,6 +13,9 @@
{% block body %}
<div class="w-container">
<div class="notice">
Log in is required to post articles.
</div>
<div {{ stimulus_controller('nostr-publish', {
publishUrl: path('api-article-publish'),
csrfToken: csrf_token('nostr_publish')

Loading…
Cancel
Save