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
[ticket/12025] Post Preview no longer shows warnings #2360
Conversation
The reason |
I don't understand why it is annoying if we get "You cannot use certain BBCodes: [url]." when clicking "Full editor & Preview". |
@prototech I disagree. Clicking "Full editor & Preview" clearly asks for the Preview and any errors that the BBcode might produce. This clearly is a regression from https://tracker.phpbb.com/browse/PHPBB3-10726 to me. Also see #670 (comment) |
I agree with bantu here |
My memory seems to be failing me. ;) It was added specifically so that you wouldn't get the "Your message contains too few characters." error when clicking on the button with no message entered since the user is simply transitioning to the full editor. See: 5ccd691 |
Well then make this one message not display on the "go to full editor" button, but all others should display? |
Agreed. |
Just don't call the parser at all when the message is empty? |
We can also change the condition to |
The last sub-condition |
@@ -879,10 +879,13 @@ | |||
$message_parser->warn_msg = array(); | |||
} | |||
|
|||
$message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); | |||
if (! ($preview && empty($message_parser->message))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the ! into the brackets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply DeMorgan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!$preview || !empty($message_parser->message))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
PHPBB3-12025
[ticket/12025] Post Preview no longer shows warnings * Nicofuma/ticket/12025: [ticket/12025] Apply DeMorgan [ticket/12025] Fixing the condition.... [ticket/12025] Don't show any error on preview if the message is empty [ticket/12025] Post Preview no longer shows warnings
https://tracker.phpbb.com/browse/PHPBB3-12025
PHPBB3-12025