function _social_post_comment_post_comment_form_submit in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.2 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.3 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.4 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.5 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.6 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.7 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 8.8 modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 10.3.x modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 10.0.x modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
- 10.1.x modules/social_features/social_post/social_post.module \_social_post_comment_post_comment_form_submit()
Form submit for comment_post_comment_form.
Parameters
array $form: Commnent on a post form.
\Drupal\Core\Form\FormStateInterface $form_state: Form state interface.
1 string reference to '_social_post_comment_post_comment_form_submit'
- social_post_form_comment_post_comment_form_alter in modules/
social_features/ social_post/ social_post.module - Implements hook_form_FORM_ID_alter().
File
- modules/
social_features/ social_post/ social_post.module, line 94 - The Social post module.
Code
function _social_post_comment_post_comment_form_submit(array $form, FormStateInterface $form_state) {
// Fetch from the form.
$uri = $form_state
->getValue('redirect_after_save');
// Let's not trust this.
$uri = Html::escape($uri);
// Must be a valid URL.
if (UrlHelper::isValid($uri)) {
// Get the Url from the Form value and redirect to this url.
$url = Url::fromUserInput($uri);
// Set redirect.
$form_state
->setRedirectUrl($url);
}
}