Guests can't post in topic via form if enable pre-moderation
-
Hello!
I have a small form for user replies in topic:
<form method="post" action="{config.relative_path}/compose"> <input type="hidden" name="tid" value="3" /> <input type="hidden" name="_csrf" value="{config.csrf_token}" /> <input type="text" placeholder="Name" required="true" name="content"> <textarea placeholder="Description" required="true" name="content"></textarea> <button type="submit" >Send</button></div> </form>
This form a works for authorized and guest users, but only with disable option
postQueue
from settingsadmin/settings/post
, when I enable this option a guest users can't posted and get error about too short message with redirect to a/compose
page after submit.How I can fix it?
-
I'm not sure I understood the question...
The guest fills out the form and clicks the submit button, after that the forum redirects to the "https://myforum.com/compose" page and there he sees an error that he entered too short a message.
If the user is logged in, there are no such errors, and after click the submit button, the forum redirects to the topic page itself with hes post.
-
Ok so looks like the issue is with your form. You have two
content
fields, which results in an array being sent to /compose route. You also have an extra closing div there that breaks the layout. Change your form to below and it should work.<form method="post" action="{config.relative_path}/compose" class="mb-5"> <input type="hidden" name="tid" value="4769" /> <input type="hidden" name="_csrf" value="{config.csrf_token}" /> <input type="text" placeholder="Name" required="true" name="handle"> <textarea placeholder="Description" required="true" name="content"></textarea> <button type="submit" >Send</button> </form>
-
@brazzerstop I will fix that so it displays the handle in the post queue and after posting.
-