Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing a post allows empty message if a file is attached, new posts do not #6870

Open
martincodeinc opened this issue Feb 28, 2024 · 0 comments
Labels

Comments

@martincodeinc
Copy link

martincodeinc commented Feb 28, 2024

What steps will reproduce the problem?

Make a new post with no content and a file attached

What is the expected result?

The post is saved

What do you get instead?

The post form says "You need to enter a message"

Additional info

Posting a new message:
The rules in modules/post/models/Post.php is preventing posting an empty message, even when e.g. an image is attached.
You always have to enter one character to get your image posted.
When you look at the validator code in in modules/post/models/forms/PostEditForm.php there seems to be such a mechanism in place to allow empty posts with at least one file attachment when editing an existing message.
Why is this not implemented with new posts?

Editing an existing message:
The rules in modules/post/models/Post.php is overruling the validate function in modules/post/models/forms/PostEditForm.php - and will never touch the validate function.

Q A
HumHub version 1.15.3
PHP version 8.2
Operating system Debian
@luke- luke- added the Kind:BUG label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants